not working yet crap

Signed-off-by: JT <john@localhost.localdomain>
This commit is contained in:
JT
2015-10-23 17:26:24 -05:00
parent dc73da3945
commit 83c4943c95
3 changed files with 22 additions and 18 deletions

2
dxf-specs.txt Normal file
View File

@ -0,0 +1,2 @@
$ANGBASE is set to 0.0, meaning 0 degrees is to the east or right.
$ANGDIR is set to 0, meaning drawing is counter-clockwise.

View File

@ -1269,7 +1269,7 @@ AcDbCircle
10
1.0
20
-1.0
9.0
30
0.0
40
@ -1299,13 +1299,13 @@ ByLayer
10
9.0
20
0.0
10.0
30
0.0
11
1.0
21
0.0
10.0
31
0.0
0
@ -1327,7 +1327,7 @@ AcDbCircle
10
9.0
20
-1.0
9.0
30
0.0
40
@ -1357,13 +1357,13 @@ ByLayer
10
10.0
20
-9.0
1.0
30
0.0
11
10.0
21
-1.0
9.0
31
0.0
0
@ -1385,7 +1385,7 @@ AcDbCircle
10
9.0
20
-9.0
1.0
30
0.0
40
@ -1415,13 +1415,13 @@ ByLayer
10
1.0
20
-10.0
0.0
30
0.0
11
9.0
21
-10.0
0.0
31
0.0
0
@ -1443,13 +1443,13 @@ ByLayer
10
0.0
20
-1.0
9.0
30
0.0
11
0.0
21
-9.0
1.0
31
0.0
0
@ -1471,7 +1471,7 @@ AcDbCircle
10
1.0
20
-9.0
1.0
30
0.0
40

View File

@ -1,18 +1,19 @@
package main
// DXF to G code converter
import (
"os"
"os/user"
"fmt"
"github.com/jethornton/dxfutil"
"os"
"os/user"
)
func main(){
func main() {
usr, _ := user.Current()
iniMap := make(map[string]string)
var inFile string
if len(os.Args) == 2 {
switch os.Args[1]{
switch os.Args[1] {
case "-v":
fmt.Println("Version 0.001")
os.Exit(0)
@ -32,12 +33,13 @@ func main(){
entities := dxfutil.GetEntities(lines)
entities = dxfutil.GetEndPoints(entities)
for _, e := range entities {
fmt.Printf("%2d %4s Xs %8s Ys %8s Xe %8s Ye %8s\n",e.Index, e.G0, e.Xs, e.Ys, e.Xe, e.Ye)
fmt.Printf("%2d %4s Xs %6s Ys %6s Xe %6s Ye %6s\n", e.Index, e.G0, e.Xs, e.Ys, e.Xe, e.Ye)
}
//start := 0
entities = dxfutil.GetIndex(entities)
for _, e := range entities {
fmt.Printf("%2d %4s Xs %8s Ys %8s Xe %8s Ye %8s\n",e.Index, e.G0, e.Xs, e.Ys, e.Xe, e.Ye)
fmt.Printf("%2d %4s Xs %6s Ys %6s Xe %6s Ye %6s\n", e.Index, e.G0, e.Xs, e.Ys, e.Xe, e.Ye)
}
dxfutil.GenGcode(entities, iniMap["SAVEAS"])
}