Documentation
¶
Overview ¶
ENTITIES section
Index ¶
- Constants
- func EntityTypeString(t EntityType) string
- func NewEntity(t EntityType) *entity
- type Arc
- func (a *Arc) Format(f format.Formatter)
- func (e Arc) Handle() int
- func (a *Arc) IsEntity() bool
- func (e Arc) Layer() *table.Layer
- func (e Arc) SetBlockRecord(h handle.Handler)
- func (e Arc) SetEntityType(t EntityType)
- func (e Arc) SetHandle(v *int)
- func (e Arc) SetLayer(l *table.Layer)
- func (e Arc) SetLtscale(v float64)
- func (e Arc) SetOwner(h handle.Handler)
- func (a *Arc) String() string
- type Circle
- func (c *Circle) BBox() ([]float64, []float64)
- func (c *Circle) CurrentCoord() []float64
- func (c *Circle) CurrentDirection() []float64
- func (c *Circle) Format(f format.Formatter)
- func (c *Circle) FormatString(f format.Formatter) string
- func (e Circle) Handle() int
- func (c *Circle) IsEntity() bool
- func (e Circle) Layer() *table.Layer
- func (e Circle) SetBlockRecord(h handle.Handler)
- func (c *Circle) SetCoord(co []float64)
- func (c *Circle) SetDirection(d []float64)
- func (e Circle) SetEntityType(t EntityType)
- func (e Circle) SetHandle(v *int)
- func (e Circle) SetLayer(l *table.Layer)
- func (e Circle) SetLtscale(v float64)
- func (e Circle) SetOwner(h handle.Handler)
- func (c *Circle) String() string
- type Entities
- type Entity
- type EntityType
- type Line
- func (l *Line) BBox() ([]float64, []float64)
- func (l *Line) Direction(normalize bool) []float64
- func (l *Line) Format(f format.Formatter)
- func (l *Line) FormatString(f format.Formatter) string
- func (e Line) Handle() int
- func (l *Line) IsEntity() bool
- func (e Line) Layer() *table.Layer
- func (l *Line) Length() float64
- func (l *Line) Move(x, y, z float64)
- func (e Line) SetBlockRecord(h handle.Handler)
- func (e Line) SetEntityType(t EntityType)
- func (e Line) SetHandle(v *int)
- func (e Line) SetLayer(l *table.Layer)
- func (e Line) SetLtscale(v float64)
- func (e Line) SetOwner(h handle.Handler)
- func (l *Line) String() string
- type LwPolyline
- func (l *LwPolyline) BBox() ([]float64, []float64)
- func (l *LwPolyline) Close()
- func (l *LwPolyline) Format(f format.Formatter)
- func (l *LwPolyline) FormatString(f format.Formatter) string
- func (e LwPolyline) Handle() int
- func (l *LwPolyline) IsEntity() bool
- func (e LwPolyline) Layer() *table.Layer
- func (e LwPolyline) SetBlockRecord(h handle.Handler)
- func (e LwPolyline) SetEntityType(t EntityType)
- func (e LwPolyline) SetHandle(v *int)
- func (e LwPolyline) SetLayer(l *table.Layer)
- func (e LwPolyline) SetLtscale(v float64)
- func (e LwPolyline) SetOwner(h handle.Handler)
- func (l *LwPolyline) String() string
- type Point
- func (p *Point) BBox() ([]float64, []float64)
- func (p *Point) Format(f format.Formatter)
- func (p *Point) FormatString(f format.Formatter) string
- func (e Point) Handle() int
- func (p *Point) IsEntity() bool
- func (e Point) Layer() *table.Layer
- func (e Point) SetBlockRecord(h handle.Handler)
- func (e Point) SetEntityType(t EntityType)
- func (e Point) SetHandle(v *int)
- func (e Point) SetLayer(l *table.Layer)
- func (e Point) SetLtscale(v float64)
- func (e Point) SetOwner(h handle.Handler)
- func (p *Point) String() string
- type Polyline
- func (p *Polyline) AddVertex(x, y, z float64) *Vertex
- func (p *Polyline) BBox() ([]float64, []float64)
- func (p *Polyline) Close()
- func (p *Polyline) Format(f format.Formatter)
- func (p *Polyline) FormatString(f format.Formatter) string
- func (e Polyline) Handle() int
- func (p *Polyline) IsEntity() bool
- func (e Polyline) Layer() *table.Layer
- func (e Polyline) SetBlockRecord(h handle.Handler)
- func (e Polyline) SetEntityType(t EntityType)
- func (p *Polyline) SetHandle(h *int)
- func (e Polyline) SetLayer(l *table.Layer)
- func (e Polyline) SetLtscale(v float64)
- func (e Polyline) SetOwner(h handle.Handler)
- func (p *Polyline) String() string
- type Spline
- func (s *Spline) BBox() ([]float64, []float64)
- func (s *Spline) Format(f format.Formatter)
- func (s *Spline) FormatString(f format.Formatter) string
- func (e Spline) Handle() int
- func (l *Spline) IsEntity() bool
- func (e Spline) Layer() *table.Layer
- func (e Spline) SetBlockRecord(h handle.Handler)
- func (e Spline) SetEntityType(t EntityType)
- func (e Spline) SetHandle(v *int)
- func (e Spline) SetLayer(l *table.Layer)
- func (e Spline) SetLtscale(v float64)
- func (e Spline) SetOwner(h handle.Handler)
- func (s *Spline) String() string
- type Text
- func (t *Text) Anchor(pos int)
- func (t *Text) BBox() ([]float64, []float64)
- func (t *Text) FlipHorizontal()
- func (t *Text) FlipVertical()
- func (t *Text) Format(f format.Formatter)
- func (t *Text) FormatString(f format.Formatter) string
- func (e Text) Handle() int
- func (t *Text) IsEntity() bool
- func (e Text) Layer() *table.Layer
- func (e Text) SetBlockRecord(h handle.Handler)
- func (e Text) SetEntityType(t EntityType)
- func (e Text) SetHandle(v *int)
- func (e Text) SetLayer(l *table.Layer)
- func (e Text) SetLtscale(v float64)
- func (e Text) SetOwner(h handle.Handler)
- func (t *Text) String() string
- type ThreeDFace
- func (f *ThreeDFace) BBox() ([]float64, []float64)
- func (f *ThreeDFace) Format(fm format.Formatter)
- func (f *ThreeDFace) FormatString(fm format.Formatter) string
- func (e ThreeDFace) Handle() int
- func (f *ThreeDFace) IsEntity() bool
- func (e ThreeDFace) Layer() *table.Layer
- func (e ThreeDFace) SetBlockRecord(h handle.Handler)
- func (e ThreeDFace) SetEntityType(t EntityType)
- func (e ThreeDFace) SetHandle(v *int)
- func (e ThreeDFace) SetLayer(l *table.Layer)
- func (e ThreeDFace) SetLtscale(v float64)
- func (e ThreeDFace) SetOwner(h handle.Handler)
- func (f *ThreeDFace) String() string
- type Vertex
- func (v *Vertex) BBox() ([]float64, []float64)
- func (v *Vertex) Format(f format.Formatter)
- func (v *Vertex) FormatString(f format.Formatter) string
- func (e Vertex) Handle() int
- func (v *Vertex) IsEntity() bool
- func (e Vertex) Layer() *table.Layer
- func (e Vertex) SetBlockRecord(h handle.Handler)
- func (e Vertex) SetEntityType(t EntityType)
- func (e Vertex) SetHandle(v *int)
- func (e Vertex) SetLayer(l *table.Layer)
- func (e Vertex) SetLtscale(v float64)
- func (e Vertex) SetOwner(h handle.Handler)
- func (v *Vertex) String() string
Constants ¶
const ( LEFT_BASE = iota CENTER_BASE RIGHT_BASE LEFT_BOTTOM CENTER_BOTTOM RIGHT_BOTTOM LEFT_CENTER CENTER_CENTER RIGHT_CENTER LEFT_TOP CENTER_TOP RIGHT_TOP )
Text Anchor
Variables ¶
This section is empty.
Functions ¶
func EntityTypeString ¶
func EntityTypeString(t EntityType) string
EntityTypeString converts EntityType to string. If EntityType is out of range, it returns empty string.
Types ¶
type Arc ¶
func (Arc) SetBlockRecord ¶
SetBlockRecord sets BLOCK_RECORD to entity (code 330).
type Circle ¶
type Circle struct { Center []float64 // 10, 20, 30 Radius float64 // 40 Direction []float64 // 210, 220, 230 // contains filtered or unexported fields }
Circle represents CIRCLE Entity.
func (*Circle) CurrentCoord ¶
CurrentCoord returns center point coord.
func (*Circle) CurrentDirection ¶
CurrentDirection returns extrusion direction.
func (*Circle) FormatString ¶
FormatString outputs data using given formatter.
func (Circle) SetBlockRecord ¶
SetBlockRecord sets BLOCK_RECORD to entity (code 330).
func (*Circle) SetDirection ¶
SetDirection sets new extrusion direction.
func (Circle) SetEntityType ¶
func (e Circle) SetEntityType(t EntityType)
SetEntityType sets entity type.
type Entities ¶
type Entities []Entity
Entities represents ENTITIES section.
type Entity ¶
type Entity interface { IsEntity() bool Format(format.Formatter) Handle() int SetHandle(*int) SetBlockRecord(handle.Handler) Layer() *table.Layer SetLayer(*table.Layer) SetLtscale(float64) BBox() ([]float64, []float64) }
Entity is interface for DXF Entities.
type EntityType ¶
type EntityType int
EntityType represents Entity names (code 2)
const ( LINE EntityType = iota THREEDFACE LWPOLYLINE CIRCLE POLYLINE VERTEX POINT ARC TEXT SPLINE )
Entity name: code 2
func EntityTypeValue ¶
func EntityTypeValue(t string) EntityType
EntityTypeValue converts string to EntityType. If string is unknown EntityType, it returns -1.
type Line ¶
type Line struct { Start []float64 // 10, 20, 30 End []float64 // 11, 21, 31 // contains filtered or unexported fields }
Line represents LINE Entity.
func (*Line) FormatString ¶
FormatString outputs data using given formatter.
func (Line) SetBlockRecord ¶
SetBlockRecord sets BLOCK_RECORD to entity (code 330).
func (Line) SetEntityType ¶
func (e Line) SetEntityType(t EntityType)
SetEntityType sets entity type.
type LwPolyline ¶
type LwPolyline struct { Num int // 90 Closed bool Vertices [][]float64 // contains filtered or unexported fields }
LwPolyline represents LWPOLYLINE Entity.
func NewLwPolyline ¶
func NewLwPolyline(size int) *LwPolyline
NewLwPolyline creates a new LwPolyline.
func (*LwPolyline) BBox ¶
func (l *LwPolyline) BBox() ([]float64, []float64)
func (*LwPolyline) Format ¶
func (l *LwPolyline) Format(f format.Formatter)
Format writes data to formatter.
func (*LwPolyline) FormatString ¶
func (l *LwPolyline) FormatString(f format.Formatter) string
FormatString outputs data using given formatter.
func (*LwPolyline) IsEntity ¶
func (l *LwPolyline) IsEntity() bool
IsEntity is for Entity interface.
func (LwPolyline) SetBlockRecord ¶
SetBlockRecord sets BLOCK_RECORD to entity (code 330).
func (LwPolyline) SetEntityType ¶
func (e LwPolyline) SetEntityType(t EntityType)
SetEntityType sets entity type.
func (LwPolyline) SetHandle ¶
func (e LwPolyline) SetHandle(v *int)
SetHandle sets handles to TABLE itself and each SymbolTable.
func (LwPolyline) SetLtscale ¶
func (e LwPolyline) SetLtscale(v float64)
SetLtscale sets Layer to entity.
func (*LwPolyline) String ¶
func (l *LwPolyline) String() string
String outputs data using default formatter.
type Point ¶
type Point struct { Coord []float64 // 10, 20, 30 // contains filtered or unexported fields }
Point represents POINT Entity.
func (*Point) FormatString ¶
FormatString outputs data using given formatter.
func (Point) SetBlockRecord ¶
SetBlockRecord sets BLOCK_RECORD to entity (code 330).
func (Point) SetEntityType ¶
func (e Point) SetEntityType(t EntityType)
SetEntityType sets entity type.
type Polyline ¶
Polyline represents POLYLINE Entity.
func (*Polyline) FormatString ¶
FormatString outputs data using given formatter.
func (Polyline) SetBlockRecord ¶
SetBlockRecord sets BLOCK_RECORD to entity (code 330).
func (Polyline) SetEntityType ¶
func (e Polyline) SetEntityType(t EntityType)
SetEntityType sets entity type.
func (Polyline) SetLtscale ¶
func (e Polyline) SetLtscale(v float64)
SetLtscale sets Layer to entity.
type Spline ¶
type Spline struct { Normal []float64 // 210, 220, 230 Flag int // 70 Degree int // 71 Knots []float64 // 72, 40 Controls [][]float64 // 73, 10, 20, 30 Fits [][]float64 // 74, 11, 21, 31 Tolerance []float64 // 42, 43, 44 // contains filtered or unexported fields }
Spline represents LINE Entity.
func (*Spline) FormatString ¶
FormatString outputs data using given formatter.
func (Spline) SetBlockRecord ¶
SetBlockRecord sets BLOCK_RECORD to entity (code 330).
func (Spline) SetEntityType ¶
func (e Spline) SetEntityType(t EntityType)
SetEntityType sets entity type.
type Text ¶
type Text struct { Coord1 []float64 // 10, 20, 30 Coord2 []float64 // 11, 21, 31 Height float64 // 40 Rotation float64 // 50 WidthFactor float64 // 41 ObliqueAngle float64 // 51 Value string // 1 Style *table.Style // 7 GenFlag int // 71 HorizontalFlag int // 72 VerticalFlag int // 73 // contains filtered or unexported fields }
Text represents TEXT Entity.
func (*Text) FlipHorizontal ¶
func (t *Text) FlipHorizontal()
FlipHorizontal flips Text horizontally.
func (*Text) FormatString ¶
FormatString outputs data using given formatter.
func (Text) SetBlockRecord ¶
SetBlockRecord sets BLOCK_RECORD to entity (code 330).
func (Text) SetEntityType ¶
func (e Text) SetEntityType(t EntityType)
SetEntityType sets entity type.
type ThreeDFace ¶
type ThreeDFace struct { Points [][]float64 Flag int // 70 // contains filtered or unexported fields }
ThreeDFace represents 3DFACE Entity.
func (*ThreeDFace) BBox ¶
func (f *ThreeDFace) BBox() ([]float64, []float64)
func (*ThreeDFace) Format ¶
func (f *ThreeDFace) Format(fm format.Formatter)
Format writes data to formatter.
func (*ThreeDFace) FormatString ¶
func (f *ThreeDFace) FormatString(fm format.Formatter) string
FormatString outputs data using given formatter.
func (*ThreeDFace) IsEntity ¶
func (f *ThreeDFace) IsEntity() bool
IsEntity is for Entity interface.
func (ThreeDFace) SetBlockRecord ¶
SetBlockRecord sets BLOCK_RECORD to entity (code 330).
func (ThreeDFace) SetEntityType ¶
func (e ThreeDFace) SetEntityType(t EntityType)
SetEntityType sets entity type.
func (ThreeDFace) SetHandle ¶
func (e ThreeDFace) SetHandle(v *int)
SetHandle sets handles to TABLE itself and each SymbolTable.
func (ThreeDFace) SetLtscale ¶
func (e ThreeDFace) SetLtscale(v float64)
SetLtscale sets Layer to entity.
func (*ThreeDFace) String ¶
func (f *ThreeDFace) String() string
String outputs data using default formatter.
type Vertex ¶
Vertex represents VERTEX Entity.
func NewDefaultVertex ¶
func NewDefaultVertex() *Vertex
func (*Vertex) FormatString ¶
FormatString outputs data using given formatter.
func (Vertex) SetBlockRecord ¶
SetBlockRecord sets BLOCK_RECORD to entity (code 330).
func (Vertex) SetEntityType ¶
func (e Vertex) SetEntityType(t EntityType)
SetEntityType sets entity type.