Documentation ¶
Index ¶
- type AcadVersion
- type BoolCodePairValue
- type CodePair
- func NewBoolCodePair(code int, value bool) CodePair
- func NewDoubleCodePair(code int, value float64) CodePair
- func NewIntCodePair(code int, value int) CodePair
- func NewLongCodePair(code int, value int64) CodePair
- func NewShortCodePair(code int, value int16) CodePair
- func NewStringCodePair(code int, value string) CodePair
- type CodePairValue
- func NewBoolCodePairValue(value bool) CodePairValue
- func NewDoubleCodePairValue(value float64) CodePairValue
- func NewIntCodePairValue(value int) CodePairValue
- func NewLongCodePairValue(value int64) CodePairValue
- func NewShortCodePairValue(value int16) CodePairValue
- func NewStringCodePairValue(value string) CodePairValue
- type Color
- type ControlPoint
- type DoubleCodePairValue
- type Drawing
- type Handle
- type IntCodePairValue
- type LineWeight
- type LongCodePairValue
- type LwVertex
- type Point
- type ShortCodePairValue
- type StringCodePairValue
- type Vector
- type ViewMode
- func (v *ViewMode) BackClippingOn() bool
- func (v *ViewMode) FrontClippingAtEye() bool
- func (v *ViewMode) FrontClippingOn() bool
- func (v *ViewMode) PerspectiveViewActive() bool
- func (v *ViewMode) SetBackClippingOn(val bool)
- func (v *ViewMode) SetFrontClippingAtEye(val bool)
- func (v *ViewMode) SetFrontClippingOn(val bool)
- func (v *ViewMode) SetPerspectiveViewActive(val bool)
- func (v *ViewMode) SetUcsFollowModeOn(val bool)
- func (v *ViewMode) UcsFollowModeOn() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcadVersion ¶
type AcadVersion int
AcadVersion represents the minimum version of AutoCAD that is expected to be able to read the file.
const ( // Version1_0 corresponds to the value "MC0.0" Version1_0 AcadVersion = iota // Version1_2 corresponds to the value "AC1.2" Version1_2 // Version1_40 corresponds to the value "AC1.40" Version1_40 // Version2_05 corresponds to the value "AC1.50" Version2_05 // Version2_10 corresponds to the value "AC2.10" Version2_10 // Version2_21 corresponds to the value "AC2.21" Version2_21 // Version2_22 corresponds to the value "AC2.22" Version2_22 // Version2_5 corresponds to the value "AC1002" Version2_5 // Version2_6 corresponds to the value "AC1003" Version2_6 // R9 corresponds to the value "AC1004" R9 // R10 corresponds to the value "AC1006" R10 // R11 corresponds to the value "AC1009" R11 // R12 corresponds to the value "AC1009" R12 // R13 corresponds to the value "AC1012" R13 // R14 corresponds to the value "AC1014" R14 // R2000 corresponds to the value "AC1015" R2000 // R2004 corresponds to the value "AC1018" R2004 // R2007 corresponds to the value "AC1021" R2007 // R2010 corresponds to the value "AC1024" R2010 // R2013 corresponds to the value "AC1027" R2013 // R2018 corresponds to the value "AC1032" R2018 )
func (AcadVersion) String ¶
func (v AcadVersion) String() string
type BoolCodePairValue ¶
type BoolCodePairValue struct { CodePairValue Value bool }
BoolCodePairValue represents a boolean code pair value.
type CodePair ¶
type CodePair struct { Code int Value CodePairValue }
CodePair represents a code and value pair from a DXF drawing.
func NewBoolCodePair ¶
NewBoolCodePair creates a code pair representing a boolean value.
func NewDoubleCodePair ¶
NewDoubleCodePair creates a code pair representing a floating point value.
func NewIntCodePair ¶
NewIntCodePair creates a code pair representing an integer value.
func NewLongCodePair ¶
NewLongCodePair creates a code pair representing a long integer value.
func NewShortCodePair ¶
NewShortCodePair creates a code pair representing a short integer value.
func NewStringCodePair ¶
NewStringCodePair creates a code pair representing a string value.
type CodePairValue ¶
type CodePairValue interface { }
CodePairValue represents a value in a single code pair.
func NewBoolCodePairValue ¶
func NewBoolCodePairValue(value bool) CodePairValue
NewBoolCodePairValue creates a boolean code pair value.
func NewDoubleCodePairValue ¶
func NewDoubleCodePairValue(value float64) CodePairValue
NewDoubleCodePairValue creates a floating point code pair value.
func NewIntCodePairValue ¶
func NewIntCodePairValue(value int) CodePairValue
NewIntCodePairValue creates an integer code pair value.
func NewLongCodePairValue ¶
func NewLongCodePairValue(value int64) CodePairValue
NewLongCodePairValue creates a long integer code pair value.
func NewShortCodePairValue ¶
func NewShortCodePairValue(value int16) CodePairValue
NewShortCodePairValue creates a short integer code pair value.
func NewStringCodePairValue ¶
func NewStringCodePairValue(value string) CodePairValue
NewStringCodePairValue creates a string code pair value.
type Color ¶
type Color int16
Color represents a color present in a DXF drawing.
func ByEntity ¶
func ByEntity() Color
ByEntity creates a color that inherits from the item's entity.
func ByLayer ¶
func ByLayer() Color
ByLayer creates a color that inherits from the item's layer color.
func (*Color) SetByBlock ¶
func (c *Color) SetByBlock()
SetByBlock sets the color to inherit from the item's block.
func (*Color) SetByEntity ¶
func (c *Color) SetByEntity()
SetByEntity sets the color to inherit from the item's entity.
func (*Color) SetByLayer ¶
func (c *Color) SetByLayer()
SetByLayer sets the color to inherit from the item's layer.
type ControlPoint ¶
ControlPoint represents a control point of a Spline
func NewControlPoint ¶
func NewControlPoint() *ControlPoint
NewControlPoint creates a new ControlPoint for a Spline
type DoubleCodePairValue ¶
type DoubleCodePairValue struct { CodePairValue Value float64 }
DoubleCodePairValue represents a floating point code pair value.
type Drawing ¶
type Drawing struct { Header Header AppIds []AppId BlockRecords []BlockRecord DimStyles []DimStyle Layers []Layer LineTypes []LineType Styles []Style Ucss []Ucs Views []View ViewPorts []ViewPort Entities []Entity }
The Drawing struct represents a complete DXF drawing.
func ParseDrawing ¶
ParseDrawing returns a drawing as parsed from a `string`.
func ReadFromReader ¶
ReadFromReader reads a DXF drawing from the specified io.Reader.
func ReadFromReaderWithEncoding ¶
ReadFromReaderWithEncoding reads a DXF drawing from the specified io.Reader with the specified default text encoding.
func (*Drawing) SaveFileBinary ¶
SaveFileBinary writes the current drawing to the specified path as a binary DXF.
func (*Drawing) SaveToWriter ¶
SaveToWriter writes the current drawing to the specified io.Writer.
func (*Drawing) SaveToWriterBinary ¶
SaveToWriterBinary writes the current drawing to the specified io.Writer as a binary DXF.
type Handle ¶
type Handle uint32
Handle represents a unique identifier for various drawing elements.
type IntCodePairValue ¶
type IntCodePairValue struct { CodePairValue Value int }
IntCodePairValue represents an integer code pair value.
type LineWeight ¶
type LineWeight int16
LineWeight represents a plotted drawing elements line weight.
const ( // LineWeightStandard represents the standard line weight. LineWeightStandard LineWeight = -3 // LineWeightByLayer represents a line weight inherited from the item's layer. LineWeightByLayer LineWeight = -2 // LineWeightByBlock represents a line weight inherited from the item's block. LineWeightByBlock LineWeight = -1 )
func NewLineWeightByBlock ¶
func NewLineWeightByBlock() LineWeight
NewLineWeightByBlock creates a line weight that is inherited from the item's block.
func NewLineWeightByLayer ¶
func NewLineWeightByLayer() LineWeight
NewLineWeightByLayer creates a line weight that is inherited from the item's layer.
func NewLineWeightStandard ¶
func NewLineWeightStandard() LineWeight
NewLineWeightStandard creates a new standard line weight.
func (*LineWeight) ByBlock ¶
func (l *LineWeight) ByBlock() bool
ByBlock returns true if the line weight is inherited from the item's block.
func (*LineWeight) ByLayer ¶
func (l *LineWeight) ByLayer() bool
ByLayer returns true if the line weight is inherited from the item's layer.
func (*LineWeight) Custom ¶
func (l *LineWeight) Custom() bool
Custom returns true if the line weight is a custom value. To retreive the custom value, use `int16(lineWeight)`.
func (*LineWeight) SetByBlock ¶
func (l *LineWeight) SetByBlock()
SetByBlock sets the line weight to inherit from the item's block.
func (*LineWeight) SetByLayer ¶
func (l *LineWeight) SetByLayer()
SetByLayer sets the line weight to inherit from the item's layer.
func (*LineWeight) SetCustom ¶
func (l *LineWeight) SetCustom(val int16)
SetCustom sets the line weight to a custom value.
func (*LineWeight) SetStandard ¶
func (l *LineWeight) SetStandard()
SetStandard sets the line weight to the standard value.
func (*LineWeight) Standard ¶
func (l *LineWeight) Standard() bool
Standard returns true if the line weight is the standard value.
type LongCodePairValue ¶
type LongCodePairValue struct { CodePairValue Value int64 }
LongCodePairValue represents a long integer code pair value.
type LwVertex ¶
type LwVertex struct { X float64 Y float64 ID int StartingWidth float64 EndingWidth float64 Bulge float64 }
LwVertex represents a vertex of an LWPolyline
func NewLwVertex ¶
func NewLwVertex() *LwVertex
NewLwVertex creates a new LwVertex for an LWPolyline
type Point ¶
The Point struct represents a 3D coordinate.
type ShortCodePairValue ¶
type ShortCodePairValue struct { CodePairValue Value int16 }
ShortCodePairValue represents a short integer code pair value.
type StringCodePairValue ¶
type StringCodePairValue struct { CodePairValue Value string }
StringCodePairValue represents a string code pair value.
type Vector ¶
The Vector struct represents a vector in 3D space.
func NewZeroVector ¶
func NewZeroVector() *Vector
NewZeroVector creates a vector representing zero distance across any axis.
type ViewMode ¶
type ViewMode int
ViewMode represents the various states a given `ViewPort` can have.
func (*ViewMode) BackClippingOn ¶
BackClippingOn specifies whether back clipping is on.
func (*ViewMode) FrontClippingAtEye ¶
FrontClippingAtEye specifies whether front eye clipping is on.
func (*ViewMode) FrontClippingOn ¶
FrontClippingOn specifies whether front clipping is on.
func (*ViewMode) PerspectiveViewActive ¶
PerspectiveViewActive specifies whether the perspective view is active.
func (*ViewMode) SetBackClippingOn ¶
SetBackClippingOn sets the front clipping state of the view.
func (*ViewMode) SetFrontClippingAtEye ¶
SetFrontClippingAtEye sets the front eye clipping mode of the view.
func (*ViewMode) SetFrontClippingOn ¶
SetFrontClippingOn sets the front clipping state of the view.
func (*ViewMode) SetPerspectiveViewActive ¶
SetPerspectiveViewActive sets the active state of the perspective view.
func (*ViewMode) SetUcsFollowModeOn ¶
SetUcsFollowModeOn sets the UCS follow mode of the view.
func (*ViewMode) UcsFollowModeOn ¶
UcsFollowModeOn specifies whether UCS follow mode is on.