diff --git a/entity/lwpolyline.go b/entity/lwpolyline.go index afe9600..2454d99 100644 --- a/entity/lwpolyline.go +++ b/entity/lwpolyline.go @@ -10,6 +10,7 @@ type LwPolyline struct { Num int // 90 Closed bool Vertices [][]float64 + Bulges []float64 } // IsEntity is for Entity interface. @@ -28,6 +29,7 @@ func NewLwPolyline(size int) *LwPolyline { Num: size, Closed: false, Vertices: vs, + Bulges: make([]float64, size), } return l } @@ -46,6 +48,9 @@ func (l *LwPolyline) Format(f format.Formatter) { for j := 0; j < 2; j++ { f.WriteFloat((j+1)*10, l.Vertices[i][j]) } + if l.Bulges[i] != 0 { + f.WriteFloat(42, l.Bulges[i]) + } } } diff --git a/parser.go b/parser.go index 58cb361..fccc630 100644 --- a/parser.go +++ b/parser.go @@ -708,6 +708,7 @@ func ParseLwPolyline(d *drawing.Drawing, data [][2]string) (entity.Entity, error err = setInt(dt, func(val int) { lw.Num = val lw.Vertices = make([][]float64, val) + lw.Bulges = make([]float64, val) for i := 0; i < val; i++ { lw.Vertices[i] = make([]float64, 2) } @@ -730,6 +731,10 @@ func ParseLwPolyline(d *drawing.Drawing, data [][2]string) (entity.Entity, error } else { err = fmt.Errorf("LWPOLYLINE extra vertices") } + case "42": + err = setFloat(dt, func(val float64) { + lw.Bulges[ind-1] = val + }) case "70": err = setInt(dt, func(val int) { if val == 1 {