Documentation
¶
Index ¶
- type Arc
- type BaseEntity
- type Circle
- type Ellipse
- type Entity
- type EntitySlice
- type HorizontalTextJustification
- type Insert
- type LWPolyLinePoint
- type LWPolyLinePointSlice
- type LWPolyline
- type Line
- type Point
- type Polyline
- type RegularEntity
- type SeqEnd
- type ShadowMode
- type SmoothSurfaceType
- type Space
- type Spline
- type Text
- type Vertex
- type VertexSlice
- type VerticalTextJustification
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Arc ¶
type Arc struct {
BaseEntity
Thickness float64
Center core.Point
Radius float64
StartAngle float64
EndAngle float64
ExtrusionDirection core.Point
}
Arc Entity representation
type BaseEntity ¶
type BaseEntity struct {
core.DxfParseable
RegularEntity
Handle string
Owner string
Space Space
LayoutTabName string
LayerName string
LineTypeName string
On bool
Color int
LineWeight int
LineTypeScale float64
Visible bool
TrueColor core.TrueColor
ColorName string
Transparency int
ShadowMode ShadowMode
}
BaseEntity holds the common part for all Entity types. New Entity types should be composed by it.
func (BaseEntity) Equals ¶
func (entity BaseEntity) Equals(other BaseEntity) bool
Equals compare two BaseEntity objects for equality. It does not implements DxfElement by design, meaning that the composed Entity structs should do.
func (*BaseEntity) InitBaseEntityParser ¶
func (entity *BaseEntity) InitBaseEntityParser()
InitBaseEntityParser Inits the EntityParsers for the BaseEntity attributes.
type Circle ¶
type Circle struct {
BaseEntity
Thickness float64
Center core.Point
Radius float64
ExtrusionDirection core.Point
}
Circle Entity representation
type Ellipse ¶
type Ellipse struct {
BaseEntity
Center core.Point
MajorAxisEnd core.Point
ExtrusionDirection core.Point
MinorToMajorAxisRatio float64
StartParameter float64
EndParameter float64
}
Ellipse Entity representation
func NewEllipse ¶
NewEllipse builds a new Ellipse from a slice of Tags.
type Entity ¶
type Entity interface {
core.DxfElement
IsSeqEnd() bool
HasNestedEntities() bool
AddNestedEntities(entities EntitySlice)
}
Entity all entities should implement this interface.
type EntitySlice ¶
type EntitySlice []Entity
EntitySlice a slice of Entity objects.
func (EntitySlice) Equals ¶
func (e EntitySlice) Equals(other EntitySlice) bool
Equals compares the EntitySlice to the other for equality.
type HorizontalTextJustification ¶
type HorizontalTextJustification int
HorizontalTextJustification Horizontal Text Justification type
const ( HTEXT_LEFT HorizontalTextJustification = iota HTEXT_CENTER HTEXT_RIGHT HTEXT_ALIGNED HTEXT_MIDDLE HTEXT_FIT )
type Insert ¶
type Insert struct {
BaseEntity
BlockName string
InsertionPoint core.Point
ScaleFactorX float64
ScaleFactorY float64
ScaleFactorZ float64
RotationAngle float64
ColumnCount int
RowCount int
ColumnSpacing float64
RowSpacing float64
AttributesFollow bool
Entities EntitySlice
ExtrusionDirection core.Point
}
Insert Entity representation
func (*Insert) AddNestedEntities ¶
func (i *Insert) AddNestedEntities(entities EntitySlice)
AddNestedEntities Add a slice of Entities as nested Entities.
func (Insert) Equals ¶
func (i Insert) Equals(other core.DxfElement) bool
Equals tests equality against another Insert.
func (Insert) HasNestedEntities ¶
HasNestedEntities a Insert will have nested entities if the AttributesFollow value is set.
type LWPolyLinePoint ¶
type LWPolyLinePoint struct {
Point core.Point
Id int
StartingWidth float64
EndWidth float64
Bulge float64
}
LWPolyLinePoint point and attributes in an LWPolyline.
func (LWPolyLinePoint) Equals ¶
func (p LWPolyLinePoint) Equals(other LWPolyLinePoint) bool
Equals compares two LWPolyLinePoints for equality
type LWPolyLinePointSlice ¶
type LWPolyLinePointSlice []LWPolyLinePoint
LWPolyLinePointSlice Slice of LWPolyLinePoint
func (LWPolyLinePointSlice) Equals ¶
func (p LWPolyLinePointSlice) Equals(other LWPolyLinePointSlice) bool
Equals Compares two LWPolyLinePointSlices for equality.
type LWPolyline ¶
type LWPolyline struct {
BaseEntity
Closed bool
Plinegen bool
ConstantWidth float64
Elevation float64
Thickness float64
Points LWPolyLinePointSlice
ExtrusionDirection core.Point
}
LWPolyline Entity representation
func NewLWPolyline ¶
func NewLWPolyline(tags core.TagSlice) (*LWPolyline, error)
NewLWPolyline builds a new LWPolyline from a slice of Tags.
func (LWPolyline) Equals ¶
func (p LWPolyline) Equals(other core.DxfElement) bool
Equals tests equality against another LWPolyline.
type Line ¶
type Line struct {
BaseEntity
Thickness float64
Start core.Point
End core.Point
ExtrusionDirection core.Point
}
Line Entity representation
type Point ¶
type Point struct {
BaseEntity
Location core.Point
Thickness float64
ExtrusionDirection core.Point
XAxisAngle float64
}
Point Entity representation
type Polyline ¶
type Polyline struct {
BaseEntity
Elevation float64
Thickness float64
Closed bool
CurveFitVerticesAdded bool
SplineFitVerticesAdded bool
Is3dPolyline bool
Is3dPolygonMesh bool
PolygonMeshClosedNDir bool
IsPolyfaceMesh bool
LineTypeParentAround bool
DefaultStartWidth float64
DefaultEndWidth float64
VertexCountM int
VertexCountN int
SmoothDensityM int
SmoothDensityN int
SmoothSurface SmoothSurfaceType
ExtrusionDirection core.Point
Vertices VertexSlice
}
Polyline Entity representation
func NewPolyline ¶
NewPolyline builds a new Polyline from a slice of Tags (without vertices)
func (*Polyline) AddNestedEntities ¶
func (p *Polyline) AddNestedEntities(entities EntitySlice)
AddNestedEntities a Polyline will contain only Vertex as nested entities, other types are simply ignored.
func (Polyline) Equals ¶
func (p Polyline) Equals(other core.DxfElement) bool
Equals tests equality against another Polyline.
func (Polyline) HasNestedEntities ¶
HasNestedEntities a Polyline will have nested entities.
type RegularEntity ¶
type RegularEntity struct{}
RegularEntity most of the Entities will return the same values for those APIs, this creates a default implementation that will be added to the BaseEntity class so that only that classes that need a different implementation need to overwrite it.
func (RegularEntity) AddNestedEntities ¶
func (r RegularEntity) AddNestedEntities(entities EntitySlice)
AddNestedEntities a default empty implementation just to implement the interface.
func (RegularEntity) HasNestedEntities ¶
func (r RegularEntity) HasNestedEntities() bool
HasNestedEntities a RegularEntity has no NestedEntities.
func (RegularEntity) IsSeqEnd ¶
func (r RegularEntity) IsSeqEnd() bool
IsSeqEnd a RegularEntity is not a SeqEnd entity.
type SeqEnd ¶
type SeqEnd struct {
BaseEntity
}
SeqEnd Entity representation
type ShadowMode ¶
type ShadowMode int
ShadowMode for the Entity. How should shadows be handled for this Entity.
const ( CASTS_AND_RECEIVE ShadowMode = iota CASTS RECEIVES IGNORES )
type SmoothSurfaceType ¶
type SmoothSurfaceType int
SmoothSurfaceType representation
const ( NO_SMOOTH_SURFACE_FITTED SmoothSurfaceType = 0 QUADRATIC_BSPLINE SmoothSurfaceType = 5 CUBIC_BSPLINE SmoothSurfaceType = 6 BEZIER SmoothSurfaceType = 8 )
type Spline ¶
type Spline struct {
BaseEntity
NormalVector core.Point
Closed bool
Periodic bool
Rational bool
Planar bool
Linear bool
Degree int
KnotTolerance float64
ControlPointTolerance float64
FitTolerance float64
StartTangent core.Point
EndTangent core.Point
KnotValues []float64
Weights []float64
ControlPoints core.PointSlice
FitPoints core.PointSlice
}
Spline Entity representation
type Text ¶
type Text struct {
BaseEntity
Thickness float64
FirstAlignmentPoint core.Point
Height float64
Value string
Rotation float64
RelativeXScale float64
ObliqueAngle float64
StyleName string
MirroredX bool
MirroredY bool
HorizontalJustification HorizontalTextJustification
SecondAlignmentPoint core.Point
ExtrusionDirection core.Point
VerticalJustification VerticalTextJustification
}
Text Entity representation
type Vertex ¶
type Vertex struct {
BaseEntity
Location core.Point
StartingWidth float64
EndWidth float64
Bulge float64
CreatedByCurveFitting bool
CurveFitTangentDefined bool
SplineVertex bool
SplineFrameCtrlPoint bool
Is3dPolylineVertex bool
Is3dPolylineMesh bool
IsPolyfaceMeshVertex bool
CurveFitTangentDirection float64
Id int
}
Vertex Entity representation
type VertexSlice ¶
type VertexSlice []*Vertex
VertexSlice a slice of Vertex objects.
func (VertexSlice) Equals ¶
func (v VertexSlice) Equals(other VertexSlice) bool
Equals Compares two Vertices for equality.
type VerticalTextJustification ¶
type VerticalTextJustification int
VerticalTextJustification Vertical Text Justification type
const ( VTEXT_BASELINE VerticalTextJustification = iota VTEXT_BOTTOM VTEXT_MIDDLE VTEXT_TOP )