From e5c242adb797f5d89531d59c5936fddae793c861 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Fri, 30 Sep 2011 19:03:10 +0200 Subject: Moved transform-insert test from minimal to dxf diff --git a/testdata/dxf/transform-insert.dxf b/testdata/dxf/transform-insert.dxf new file mode 100644 index 0000000..40064c2 --- /dev/null +++ b/testdata/dxf/transform-insert.dxf @@ -0,0 +1,2980 @@ +999 +dxflib 2.2.0.0 + 0 +SECTION + 2 +HEADER + 9 +$ACADVER + 1 +AC1015 + 9 +$HANDSEED + 5 +FFFF + 9 +$DIMASZ + 40 +2.5 + 9 +$PLIMMIN + 10 +0.0 + 20 +0.0 + 9 +$DIMEXE + 40 +1.25 + 9 +$DIMGAP + 40 +0.625 + 9 +$PLIMMAX + 10 +210.0 + 20 +297.0 + 9 +$INSUNITS + 70 +4 + 9 +$DIMEXO + 40 +0.625 + 9 +$DIMTXT + 40 +2.5 + 9 +$CLAYER + 8 +0 + 0 +ENDSEC + 0 +SECTION + 2 +TABLES + 0 +TABLE + 2 +VPORT + 5 +8 +100 +AcDbSymbolTable + 70 +1 + 0 +VPORT + 5 +30 +100 +AcDbSymbolTableRecord +100 +AcDbViewportTableRecord + 2 +*Active + 70 +0 + 10 +0.0 + 20 +0.0 + 11 +1.0 + 21 +1.0 + 12 +286.3055555555554861 + 22 +148.5 + 13 +0.0 + 23 +0.0 + 14 +10.0 + 24 +10.0 + 15 +10.0 + 25 +10.0 + 16 +0.0 + 26 +0.0 + 36 +1.0 + 17 +0.0 + 27 +0.0 + 37 +0.0 + 40 +297.0 + 41 +1.92798353909465 + 42 +50.0 + 43 +0.0 + 44 +0.0 + 50 +0.0 + 51 +0.0 + 71 +0 + 72 +100 + 73 +1 + 74 +3 + 75 +1 + 76 +1 + 77 +0 + 78 +0 +281 +0 + 65 +1 +110 +0.0 +120 +0.0 +130 +0.0 +111 +1.0 +121 +0.0 +131 +0.0 +112 +0.0 +122 +1.0 +132 +0.0 + 79 +0 +146 +0.0 + 0 +ENDTAB + 0 +TABLE + 2 +LTYPE + 5 +5 +100 +AcDbSymbolTable + 70 +21 + 0 +LTYPE + 5 +14 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +ByBlock + 70 +0 + 3 + + 72 +65 + 73 +0 + 40 +0.0 + 0 +LTYPE + 5 +15 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +ByLayer + 70 +0 + 3 + + 72 +65 + 73 +0 + 40 +0.0 + 0 +LTYPE + 5 +16 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +CONTINUOUS + 70 +0 + 3 +Solid line + 72 +65 + 73 +0 + 40 +0.0 + 0 +LTYPE + 5 +31 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +DOT + 70 +0 + 3 +Dot . . . . . . . . . . . . . . . . . . . . . . + 72 +65 + 73 +2 + 40 +6.3499999999999996 + 49 +0.0 + 74 +0 + 49 +-6.3499999999999996 + 74 +0 + 0 +LTYPE + 5 +32 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +DOT2 + 70 +0 + 3 +Dot (.5x) ..................................... + 72 +65 + 73 +2 + 40 +3.1749999999999998 + 49 +0.0 + 74 +0 + 49 +-3.1749999999999998 + 74 +0 + 0 +LTYPE + 5 +33 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +DOTX2 + 70 +0 + 3 +Dot (2x) . . . . . . . . . . . . . + 72 +65 + 73 +2 + 40 +12.6999999999999993 + 49 +0.0 + 74 +0 + 49 +-12.6999999999999993 + 74 +0 + 0 +LTYPE + 5 +34 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +DASHED + 70 +0 + 3 +Dashed __ __ __ __ __ __ __ __ __ __ __ __ __ _ + 72 +65 + 73 +2 + 40 +19.0500000000000007 + 49 +12.6999999999999993 + 74 +0 + 49 +-6.3499999999999996 + 74 +0 + 0 +LTYPE + 5 +35 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +DASHED2 + 70 +0 + 3 +Dashed (.5x) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + 72 +65 + 73 +2 + 40 +9.5250000000000004 + 49 +6.3499999999999996 + 74 +0 + 49 +-3.1749999999999998 + 74 +0 + 0 +LTYPE + 5 +36 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +DASHEDX2 + 70 +0 + 3 +Dashed (2x) ____ ____ ____ ____ ____ ___ + 72 +65 + 73 +2 + 40 +38.1000000000000014 + 49 +25.3999999999999986 + 74 +0 + 49 +-12.6999999999999993 + 74 +0 + 0 +LTYPE + 5 +37 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +DASHDOT + 70 +0 + 3 +Dash dot __ . __ . __ . __ . __ . __ . __ . __ + 72 +65 + 73 +4 + 40 +25.3999999999999986 + 49 +12.6999999999999993 + 74 +0 + 49 +-6.3499999999999996 + 74 +0 + 49 +0.0 + 74 +0 + 49 +-6.3499999999999996 + 74 +0 + 0 +LTYPE + 5 +38 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +DASHDOT2 + 70 +0 + 3 +Dash dot (.5x) _._._._._._._._._._._._._._._. + 72 +65 + 73 +4 + 40 +12.6999999999999993 + 49 +6.3499999999999996 + 74 +0 + 49 +-3.1749999999999998 + 74 +0 + 49 +0.0 + 74 +0 + 49 +-3.1749999999999998 + 74 +0 + 0 +LTYPE + 5 +39 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +DASHDOTX2 + 70 +0 + 3 +Dash dot (2x) ____ . ____ . ____ . ___ + 72 +65 + 73 +4 + 40 +50.7999999999999972 + 49 +25.3999999999999986 + 74 +0 + 49 +-12.6999999999999993 + 74 +0 + 49 +0.0 + 74 +0 + 49 +-12.6999999999999993 + 74 +0 + 0 +LTYPE + 5 +3A +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +DIVIDE + 70 +0 + 3 +Divide ____ . . ____ . . ____ . . ____ . . ____ + 72 +65 + 73 +6 + 40 +31.75 + 49 +12.6999999999999993 + 74 +0 + 49 +-6.3499999999999996 + 74 +0 + 49 +0.0 + 74 +0 + 49 +-6.3499999999999996 + 74 +0 + 49 +0.0 + 74 +0 + 49 +-6.3499999999999996 + 74 +0 + 0 +LTYPE + 5 +3B +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +DIVIDE2 + 70 +0 + 3 +Divide (.5x) __..__..__..__..__..__..__..__.._ + 72 +65 + 73 +6 + 40 +15.875 + 49 +6.3499999999999996 + 74 +0 + 49 +-3.1749999999999998 + 74 +0 + 49 +0.0 + 74 +0 + 49 +-3.1749999999999998 + 74 +0 + 49 +0.0 + 74 +0 + 49 +-3.1749999999999998 + 74 +0 + 0 +LTYPE + 5 +3C +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +DIVIDEX2 + 70 +0 + 3 +Divide (2x) ________ . . ________ . . _ + 72 +65 + 73 +6 + 40 +63.5 + 49 +25.3999999999999986 + 74 +0 + 49 +-12.6999999999999993 + 74 +0 + 49 +0.0 + 74 +0 + 49 +-12.6999999999999993 + 74 +0 + 49 +0.0 + 74 +0 + 49 +-12.6999999999999993 + 74 +0 + 0 +LTYPE + 5 +3D +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +CENTER + 70 +0 + 3 +Center ____ _ ____ _ ____ _ ____ _ ____ _ ____ + 72 +65 + 73 +4 + 40 +50.7999999999999972 + 49 +31.75 + 74 +0 + 49 +-6.3499999999999996 + 74 +0 + 49 +6.3499999999999996 + 74 +0 + 49 +-6.3499999999999996 + 74 +0 + 0 +LTYPE + 5 +3E +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +CENTER2 + 70 +0 + 3 +Center (.5x) ___ _ ___ _ ___ _ ___ _ ___ _ ___ + 72 +65 + 73 +4 + 40 +28.5749999999999993 + 49 +19.0500000000000007 + 74 +0 + 49 +-3.1749999999999998 + 74 +0 + 49 +3.1749999999999998 + 74 +0 + 49 +-3.1749999999999998 + 74 +0 + 0 +LTYPE + 5 +3F +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +CENTERX2 + 70 +0 + 3 +Center (2x) ________ __ ________ __ _____ + 72 +65 + 73 +4 + 40 +101.5999999999999943 + 49 +63.5 + 74 +0 + 49 +-12.6999999999999993 + 74 +0 + 49 +12.6999999999999993 + 74 +0 + 49 +-12.6999999999999993 + 74 +0 + 0 +LTYPE + 5 +40 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +BORDER + 70 +0 + 3 +Border __ __ . __ __ . __ __ . __ __ . __ __ . + 72 +65 + 73 +6 + 40 +44.4500000000000028 + 49 +12.6999999999999993 + 74 +0 + 49 +-6.3499999999999996 + 74 +0 + 49 +12.6999999999999993 + 74 +0 + 49 +-6.3499999999999996 + 74 +0 + 49 +0.0 + 74 +0 + 49 +-6.3499999999999996 + 74 +0 + 0 +LTYPE + 5 +41 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +BORDER2 + 70 +0 + 3 +Border (.5x) __.__.__.__.__.__.__.__.__.__.__. + 72 +65 + 73 +6 + 40 +22.2250000000000014 + 49 +6.3499999999999996 + 74 +0 + 49 +-3.1749999999999998 + 74 +0 + 49 +6.3499999999999996 + 74 +0 + 49 +-3.1749999999999998 + 74 +0 + 49 +0.0 + 74 +0 + 49 +-3.1749999999999998 + 74 +0 + 0 +LTYPE + 5 +42 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +BORDERX2 + 70 +0 + 3 +Border (2x) ____ ____ . ____ ____ . ___ + 72 +65 + 73 +6 + 40 +88.9000000000000057 + 49 +25.3999999999999986 + 74 +0 + 49 +-12.6999999999999993 + 74 +0 + 49 +25.3999999999999986 + 74 +0 + 49 +-12.6999999999999993 + 74 +0 + 49 +0.0 + 74 +0 + 49 +-12.6999999999999993 + 74 +0 + 0 +ENDTAB + 0 +TABLE + 2 +LAYER + 5 +2 +100 +AcDbSymbolTable + 70 +1 + 0 +LAYER + 5 +10 +100 +AcDbSymbolTableRecord +100 +AcDbLayerTableRecord + 2 +0 + 70 +0 + 62 +7 +420 +0 + 6 +CONTINUOUS +370 +25 +390 +F + 0 +ENDTAB + 0 +TABLE + 2 +STYLE + 5 +3 +100 +AcDbSymbolTable + 70 +1 + 0 +STYLE + 5 +11 +100 +AcDbSymbolTableRecord +100 +AcDbTextStyleTableRecord + 2 +Standard + 70 +0 + 40 +0.0 + 41 +0.75 + 50 +0.0 + 71 +0 + 42 +2.5 + 3 +txt + 4 + + 0 +ENDTAB + 0 +TABLE + 2 +VIEW + 5 +6 +100 +AcDbSymbolTable + 70 +0 + 0 +ENDTAB + 0 +TABLE + 2 +UCS + 5 +7 +100 +AcDbSymbolTable + 70 +0 + 0 +ENDTAB + 0 +TABLE + 2 +APPID + 5 +9 +100 +AcDbSymbolTable + 70 +1 + 0 +APPID + 5 +12 +100 +AcDbSymbolTableRecord +100 +AcDbRegAppTableRecord + 2 +ACAD + 70 +0 + 0 +ENDTAB + 0 +TABLE + 2 +DIMSTYLE + 5 +A +100 +AcDbSymbolTable + 70 +1 +100 +AcDbDimStyleTable + 71 +0 + 0 +DIMSTYLE +105 +27 +100 +AcDbSymbolTableRecord +100 +AcDbDimStyleTableRecord + 2 +Standard + 41 +2.5 + 42 +0.625 + 43 +3.75 + 44 +1.25 + 70 +0 + 73 +0 + 74 +0 + 77 +1 + 78 +8 +140 +2.5 +141 +2.5 +143 +0.03937007874016 +147 +0.625 +171 +3 +172 +1 +271 +2 +272 +2 +274 +3 +278 +44 +283 +0 +284 +8 +340 +11 + 0 +ENDTAB + 0 +TABLE + 2 +BLOCK_RECORD + 5 +1 +100 +AcDbSymbolTable + 70 +1 + 0 +BLOCK_RECORD + 5 +1F +100 +AcDbSymbolTableRecord +100 +AcDbBlockTableRecord + 2 +*Model_Space +340 +22 + 0 +BLOCK_RECORD + 5 +1B +100 +AcDbSymbolTableRecord +100 +AcDbBlockTableRecord + 2 +*Paper_Space +340 +1E + 0 +BLOCK_RECORD + 5 +23 +100 +AcDbSymbolTableRecord +100 +AcDbBlockTableRecord + 2 +*Paper_Space0 +340 +26 + 0 +BLOCK_RECORD + 5 +43 +100 +AcDbSymbolTableRecord +100 +AcDbBlockTableRecord + 2 +testblock +340 +0 + 0 +BLOCK_RECORD + 5 +44 +100 +AcDbSymbolTableRecord +100 +AcDbBlockTableRecord + 2 +testblock2 +340 +0 + 0 +ENDTAB + 0 +ENDSEC + 0 +SECTION + 2 +BLOCKS + 0 +BLOCK + 5 +20 +100 +AcDbEntity + 8 +0 +100 +AcDbBlockBegin + 2 +*Model_Space + 70 +0 + 10 +0.0 + 20 +0.0 + 30 +0.0 + 3 +*Model_Space + 1 + + 0 +ENDBLK + 5 +21 +100 +AcDbEntity + 8 +0 +100 +AcDbBlockEnd + 0 +BLOCK + 5 +1C +100 +AcDbEntity + 67 +1 + 8 +0 +100 +AcDbBlockBegin + 2 +*Paper_Space + 70 +0 + 10 +0.0 + 20 +0.0 + 30 +0.0 + 3 +*Paper_Space + 1 + + 0 +ENDBLK + 5 +1D +100 +AcDbEntity + 67 +1 + 8 +0 +100 +AcDbBlockEnd + 0 +BLOCK + 5 +24 +100 +AcDbEntity + 8 +0 +100 +AcDbBlockBegin + 2 +*Paper_Space0 + 70 +0 + 10 +0.0 + 20 +0.0 + 30 +0.0 + 3 +*Paper_Space0 + 1 + + 0 +ENDBLK + 5 +25 +100 +AcDbEntity + 8 +0 +100 +AcDbBlockEnd + 0 +BLOCK + 5 +45 +100 +AcDbEntity + 8 +0 +100 +AcDbBlockBegin + 2 +testblock + 70 +0 + 10 +0.0 + 20 +0.0 + 30 +0.0 + 3 +testblock + 1 + + 0 +LINE + 5 +46 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +-1.0 + 20 +0.0 + 30 +0.0 + 11 +-1.0 + 21 +2.0 + 31 +0.0 + 0 +LINE + 5 +47 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +-1.0 + 20 +2.0 + 30 +0.0 + 11 +-3.0 + 21 +2.0 + 31 +0.0 + 0 +LINE + 5 +48 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +-3.0 + 20 +2.0 + 30 +0.0 + 11 +-3.0 + 21 +4.0 + 31 +0.0 + 0 +LINE + 5 +49 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +-3.0 + 20 +4.0 + 30 +0.0 + 11 +3.0 + 21 +4.0 + 31 +0.0 + 0 +LINE + 5 +4A +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +3.0 + 20 +4.0 + 30 +0.0 + 11 +3.0 + 21 +2.0 + 31 +0.0 + 0 +LINE + 5 +4B +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +3.0 + 20 +2.0 + 30 +0.0 + 11 +1.0 + 21 +2.0 + 31 +0.0 + 0 +LINE + 5 +4C +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +1.0 + 20 +2.0 + 30 +0.0 + 11 +1.0 + 21 +0.0 + 31 +0.0 + 0 +ENDBLK + 5 +4D +100 +AcDbEntity + 8 +0 +100 +AcDbBlockEnd + 0 +BLOCK + 5 +4E +100 +AcDbEntity + 8 +0 +100 +AcDbBlockBegin + 2 +testblock2 + 70 +0 + 10 +0.0 + 20 +0.0 + 30 +0.0 + 3 +testblock2 + 1 + + 0 +LINE + 5 +4F +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +-1.0000000000000004 + 20 +6.0 + 30 +0.0 + 11 +-1.0 + 21 +8.0 + 31 +0.0 + 0 +LINE + 5 +50 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +-1.0 + 20 +8.0 + 30 +0.0 + 11 +-3.0 + 21 +8.0 + 31 +0.0 + 0 +LINE + 5 +51 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +-3.0 + 20 +8.0 + 30 +0.0 + 11 +-3.0 + 21 +10.0 + 31 +0.0 + 0 +LINE + 5 +52 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +-3.0 + 20 +10.0 + 30 +0.0 + 11 +3.0 + 21 +10.0 + 31 +0.0 + 0 +LINE + 5 +53 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +3.0 + 20 +10.0 + 30 +0.0 + 11 +3.0 + 21 +8.0 + 31 +0.0 + 0 +LINE + 5 +54 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +3.0 + 20 +8.0 + 30 +0.0 + 11 +1.0 + 21 +8.0 + 31 +0.0 + 0 +LINE + 5 +55 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +1.0 + 20 +8.0 + 30 +0.0 + 11 +0.9999999999999998 + 21 +6.0 + 31 +0.0 + 0 +ENDBLK + 5 +56 +100 +AcDbEntity + 8 +0 +100 +AcDbBlockEnd + 0 +ENDSEC + 0 +SECTION + 2 +ENTITIES + 0 +LINE + 5 +57 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +10.0 + 20 +10.0 + 30 +0.0 + 11 +10.0 + 21 +-10.0 + 31 +0.0 + 0 +LINE + 5 +58 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +-10.0 + 20 +-10.0 + 30 +0.0 + 11 +-10.0 + 21 +10.0 + 31 +0.0 + 0 +LINE + 5 +59 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +-10.0 + 20 +10.0 + 30 +0.0 + 11 +-1.0 + 21 +10.0 + 31 +0.0 + 0 +LINE + 5 +5A +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +1.0 + 20 +10.0 + 30 +0.0 + 11 +10.0 + 21 +10.0 + 31 +0.0 + 0 +LINE + 5 +5B +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +10.0 + 20 +-10.0 + 30 +0.0 + 11 +1.0 + 21 +-10.0 + 31 +0.0 + 0 +LINE + 5 +5C +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +-1.0 + 20 +-10.0 + 30 +0.0 + 11 +-10.0 + 21 +-10.0 + 31 +0.0 + 0 +LINE + 5 +5D +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +40.0 + 20 +10.0 + 30 +0.0 + 11 +40.0 + 21 +-10.0 + 31 +0.0 + 0 +LINE + 5 +5E +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +20.0 + 20 +-10.0 + 30 +0.0 + 11 +20.0 + 21 +10.0 + 31 +0.0 + 0 +LINE + 5 +5F +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +20.0 + 20 +10.0 + 30 +0.0 + 11 +29.0 + 21 +10.0 + 31 +0.0 + 0 +LINE + 5 +60 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +31.0 + 20 +10.0 + 30 +0.0 + 11 +40.0 + 21 +10.0 + 31 +0.0 + 0 +LINE + 5 +61 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +40.0 + 20 +-10.0 + 30 +0.0 + 11 +31.0 + 21 +-10.0 + 31 +0.0 + 0 +LINE + 5 +62 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +29.0 + 20 +-10.0 + 30 +0.0 + 11 +20.0 + 21 +-10.0 + 31 +0.0 + 0 +INSERT + 5 +63 +100 +AcDbEntity +100 +AcDbBlockReference + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 2 +testblock2 + 10 +29.9999999999999964 + 20 +-4.0 + 30 +0.0 + 41 +1.0 + 42 +-1.0 + 43 +1.0 + 50 +360.0 + 44 +1.0 + 45 +1.0 + 0 +INSERT + 5 +64 +100 +AcDbEntity +100 +AcDbBlockReference + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 2 +testblock2 + 10 +30.0 + 20 +4.0 + 30 +0.0 + 44 +1.0 + 45 +1.0 + 0 +INSERT + 5 +65 +100 +AcDbEntity +100 +AcDbBlockReference + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 2 +testblock + 10 +0.0 + 20 +-10.0 + 30 +0.0 + 41 +1.0 + 42 +-1.0 + 43 +1.0 + 50 +360.0 + 44 +1.0 + 45 +1.0 + 0 +INSERT + 5 +66 +100 +AcDbEntity +100 +AcDbBlockReference + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 2 +testblock + 10 +0.0 + 20 +10.0 + 30 +0.0 + 44 +1.0 + 45 +1.0 + 0 +LINE + 5 +67 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +60.0 + 20 +7.0710678118654755 + 30 +0.0 + 11 +67.0710678118654755 + 21 +-0.0000000000000017 + 31 +0.0 + 0 +LINE + 5 +68 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +60.0 + 20 +-7.0710678118654755 + 30 +0.0 + 11 +52.9289321881345245 + 21 +0.0000000000000009 + 31 +0.0 + 0 +LINE + 5 +69 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +52.9289321881345245 + 20 +0.0000000000000009 + 30 +0.0 + 11 +56.1109127034739927 + 21 +3.1819805153394651 + 31 +0.0 + 0 +LINE + 5 +6A +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +56.8180194846605389 + 20 +3.8890872965260113 + 30 +0.0 + 11 +60.0 + 21 +7.0710678118654755 + 31 +0.0 + 0 +LINE + 5 +6B +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +67.0710678118654755 + 20 +-0.0000000000000017 + 30 +0.0 + 11 +63.8890872965260073 + 21 +-3.1819805153394651 + 31 +0.0 + 0 +LINE + 5 +6C +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +63.1819805153394611 + 20 +-3.8890872965260117 + 30 +0.0 + 11 +60.0 + 21 +-7.0710678118654755 + 31 +0.0 + 0 +INSERT + 5 +6D +100 +AcDbEntity +100 +AcDbBlockReference + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 2 +testblock2 + 10 +58.5857864376269077 + 20 +1.4142135623730963 + 30 +0.0 + 41 +0.5 + 42 +0.5 + 43 +1.0 + 50 +45.0 + 44 +1.0 + 45 +1.0 + 0 +INSERT + 5 +6E +100 +AcDbEntity +100 +AcDbBlockReference + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 2 +testblock2 + 10 +61.4142135623730923 + 20 +-1.4142135623730949 + 30 +0.0 + 41 +0.5 + 42 +0.5 + 43 +1.0 + 50 +-135.0 + 44 +1.0 + 45 +1.0 + 0 +ENDSEC + 0 +SECTION + 2 +OBJECTS + 0 +DICTIONARY + 5 +C +100 +AcDbDictionary +280 +0 +281 +1 + 3 +ACAD_GROUP +350 +D + 3 +ACAD_LAYOUT +350 +1A + 3 +ACAD_MLINESTYLE +350 +17 + 3 +ACAD_PLOTSETTINGS +350 +19 + 3 +ACAD_PLOTSTYLENAME +350 +E + 3 +AcDbVariableDictionary +350 +6F + 0 +DICTIONARY + 5 +D +100 +AcDbDictionary +280 +0 +281 +1 + 0 +ACDBDICTIONARYWDFLT + 5 +E +100 +AcDbDictionary +281 +1 + 3 +Normal +350 +F +100 +AcDbDictionaryWithDefault +340 +F + 0 +ACDBPLACEHOLDER + 5 +F + 0 +DICTIONARY + 5 +17 +100 +AcDbDictionary +280 +0 +281 +1 + 3 +Standard +350 +18 + 0 +MLINESTYLE + 5 +18 +100 +AcDbMlineStyle + 2 +STANDARD + 70 +0 + 3 + + 62 +256 + 51 +90.0 + 52 +90.0 + 71 +2 + 49 +0.5 + 62 +256 + 6 +BYLAYER + 49 +-0.5 + 62 +256 + 6 +BYLAYER + 0 +DICTIONARY + 5 +19 +100 +AcDbDictionary +280 +0 +281 +1 + 0 +DICTIONARY + 5 +1A +100 +AcDbDictionary +281 +1 + 3 +Layout1 +350 +1E + 3 +Layout2 +350 +26 + 3 +Model +350 +22 + 0 +LAYOUT + 5 +1E +100 +AcDbPlotSettings + 1 + + 2 +C:\Program Files\AutoCAD 2002\plotters\DWF ePlot (optimized for plotting).pc3 + 4 + + 6 + + 40 +0.0 + 41 +0.0 + 42 +0.0 + 43 +0.0 + 44 +0.0 + 45 +0.0 + 46 +0.0 + 47 +0.0 + 48 +0.0 + 49 +0.0 +140 +0.0 +141 +0.0 +142 +1.0 +143 +1.0 + 70 +688 + 72 +0 + 73 +0 + 74 +5 + 7 + + 75 +16 +147 +1.0 +148 +0.0 +149 +0.0 +100 +AcDbLayout + 1 +Layout1 + 70 +1 + 71 +1 + 10 +0.0 + 20 +0.0 + 11 +420.0 + 21 +297.0 + 12 +0.0 + 22 +0.0 + 32 +0.0 + 14 +100000000000000000000.0 + 24 +100000000000000000000.0 + 34 +100000000000000000000.0 + 15 +-100000000000000000000.0 + 25 +-100000000000000000000.0 + 35 +-100000000000000000000.0 +146 +0.0 + 13 +0.0 + 23 +0.0 + 33 +0.0 + 16 +1.0 + 26 +0.0 + 36 +0.0 + 17 +0.0 + 27 +1.0 + 37 +0.0 + 76 +0 +330 +1B + 0 +LAYOUT + 5 +22 +100 +AcDbPlotSettings + 1 + + 2 +C:\Program Files\AutoCAD 2002\plotters\DWF ePlot (optimized for plotting).pc3 + 4 + + 6 + + 40 +0.0 + 41 +0.0 + 42 +0.0 + 43 +0.0 + 44 +0.0 + 45 +0.0 + 46 +0.0 + 47 +0.0 + 48 +0.0 + 49 +0.0 +140 +0.0 +141 +0.0 +142 +1.0 +143 +1.0 + 70 +1712 + 72 +0 + 73 +0 + 74 +0 + 7 + + 75 +0 +147 +1.0 +148 +0.0 +149 +0.0 +100 +AcDbLayout + 1 +Model + 70 +1 + 71 +0 + 10 +0.0 + 20 +0.0 + 11 +12.0 + 21 +9.0 + 12 +0.0 + 22 +0.0 + 32 +0.0 + 14 +0.0 + 24 +0.0 + 34 +0.0 + 15 +0.0 + 25 +0.0 + 35 +0.0 +146 +0.0 + 13 +0.0 + 23 +0.0 + 33 +0.0 + 16 +1.0 + 26 +0.0 + 36 +0.0 + 17 +0.0 + 27 +1.0 + 37 +0.0 + 76 +0 +330 +1F + 0 +LAYOUT + 5 +26 +100 +AcDbPlotSettings + 1 + + 2 +C:\Program Files\AutoCAD 2002\plotters\DWF ePlot (optimized for plotting).pc3 + 4 + + 6 + + 40 +0.0 + 41 +0.0 + 42 +0.0 + 43 +0.0 + 44 +0.0 + 45 +0.0 + 46 +0.0 + 47 +0.0 + 48 +0.0 + 49 +0.0 +140 +0.0 +141 +0.0 +142 +1.0 +143 +1.0 + 70 +688 + 72 +0 + 73 +0 + 74 +5 + 7 + + 75 +16 +147 +1.0 +148 +0.0 +149 +0.0 +100 +AcDbLayout + 1 +Layout2 + 70 +1 + 71 +2 + 10 +0.0 + 20 +0.0 + 11 +12.0 + 21 +9.0 + 12 +0.0 + 22 +0.0 + 32 +0.0 + 14 +0.0 + 24 +0.0 + 34 +0.0 + 15 +0.0 + 25 +0.0 + 35 +0.0 +146 +0.0 + 13 +0.0 + 23 +0.0 + 33 +0.0 + 16 +1.0 + 26 +0.0 + 36 +0.0 + 17 +0.0 + 27 +1.0 + 37 +0.0 + 76 +0 +330 +23 + 0 +DICTIONARY + 5 +6F +100 +AcDbDictionary +281 +1 + 3 +DIMASSOC +350 +71 + 3 +HIDETEXT +350 +70 + 0 +DICTIONARYVAR + 5 +70 +100 +DictionaryVariables +280 +0 + 1 +2 + 0 +DICTIONARYVAR + 5 +71 +100 +DictionaryVariables +280 +0 + 1 +1 + 0 +ENDSEC + 0 +EOF diff --git a/testdata/scad/dxf/transform-insert.scad b/testdata/scad/dxf/transform-insert.scad new file mode 100644 index 0000000..28595a3 --- /dev/null +++ b/testdata/scad/dxf/transform-insert.scad @@ -0,0 +1 @@ +import_dxf("../../dxf/transform-insert.dxf"); diff --git a/testdata/scad/minimal/transform-insert.dxf b/testdata/scad/minimal/transform-insert.dxf deleted file mode 100644 index 40064c2..0000000 --- a/testdata/scad/minimal/transform-insert.dxf +++ /dev/null @@ -1,2980 +0,0 @@ -999 -dxflib 2.2.0.0 - 0 -SECTION - 2 -HEADER - 9 -$ACADVER - 1 -AC1015 - 9 -$HANDSEED - 5 -FFFF - 9 -$DIMASZ - 40 -2.5 - 9 -$PLIMMIN - 10 -0.0 - 20 -0.0 - 9 -$DIMEXE - 40 -1.25 - 9 -$DIMGAP - 40 -0.625 - 9 -$PLIMMAX - 10 -210.0 - 20 -297.0 - 9 -$INSUNITS - 70 -4 - 9 -$DIMEXO - 40 -0.625 - 9 -$DIMTXT - 40 -2.5 - 9 -$CLAYER - 8 -0 - 0 -ENDSEC - 0 -SECTION - 2 -TABLES - 0 -TABLE - 2 -VPORT - 5 -8 -100 -AcDbSymbolTable - 70 -1 - 0 -VPORT - 5 -30 -100 -AcDbSymbolTableRecord -100 -AcDbViewportTableRecord - 2 -*Active - 70 -0 - 10 -0.0 - 20 -0.0 - 11 -1.0 - 21 -1.0 - 12 -286.3055555555554861 - 22 -148.5 - 13 -0.0 - 23 -0.0 - 14 -10.0 - 24 -10.0 - 15 -10.0 - 25 -10.0 - 16 -0.0 - 26 -0.0 - 36 -1.0 - 17 -0.0 - 27 -0.0 - 37 -0.0 - 40 -297.0 - 41 -1.92798353909465 - 42 -50.0 - 43 -0.0 - 44 -0.0 - 50 -0.0 - 51 -0.0 - 71 -0 - 72 -100 - 73 -1 - 74 -3 - 75 -1 - 76 -1 - 77 -0 - 78 -0 -281 -0 - 65 -1 -110 -0.0 -120 -0.0 -130 -0.0 -111 -1.0 -121 -0.0 -131 -0.0 -112 -0.0 -122 -1.0 -132 -0.0 - 79 -0 -146 -0.0 - 0 -ENDTAB - 0 -TABLE - 2 -LTYPE - 5 -5 -100 -AcDbSymbolTable - 70 -21 - 0 -LTYPE - 5 -14 -100 -AcDbSymbolTableRecord -100 -AcDbLinetypeTableRecord - 2 -ByBlock - 70 -0 - 3 - - 72 -65 - 73 -0 - 40 -0.0 - 0 -LTYPE - 5 -15 -100 -AcDbSymbolTableRecord -100 -AcDbLinetypeTableRecord - 2 -ByLayer - 70 -0 - 3 - - 72 -65 - 73 -0 - 40 -0.0 - 0 -LTYPE - 5 -16 -100 -AcDbSymbolTableRecord -100 -AcDbLinetypeTableRecord - 2 -CONTINUOUS - 70 -0 - 3 -Solid line - 72 -65 - 73 -0 - 40 -0.0 - 0 -LTYPE - 5 -31 -100 -AcDbSymbolTableRecord -100 -AcDbLinetypeTableRecord - 2 -DOT - 70 -0 - 3 -Dot . . . . . . . . . . . . . . . . . . . . . . - 72 -65 - 73 -2 - 40 -6.3499999999999996 - 49 -0.0 - 74 -0 - 49 --6.3499999999999996 - 74 -0 - 0 -LTYPE - 5 -32 -100 -AcDbSymbolTableRecord -100 -AcDbLinetypeTableRecord - 2 -DOT2 - 70 -0 - 3 -Dot (.5x) ..................................... - 72 -65 - 73 -2 - 40 -3.1749999999999998 - 49 -0.0 - 74 -0 - 49 --3.1749999999999998 - 74 -0 - 0 -LTYPE - 5 -33 -100 -AcDbSymbolTableRecord -100 -AcDbLinetypeTableRecord - 2 -DOTX2 - 70 -0 - 3 -Dot (2x) . . . . . . . . . . . . . - 72 -65 - 73 -2 - 40 -12.6999999999999993 - 49 -0.0 - 74 -0 - 49 --12.6999999999999993 - 74 -0 - 0 -LTYPE - 5 -34 -100 -AcDbSymbolTableRecord -100 -AcDbLinetypeTableRecord - 2 -DASHED - 70 -0 - 3 -Dashed __ __ __ __ __ __ __ __ __ __ __ __ __ _ - 72 -65 - 73 -2 - 40 -19.0500000000000007 - 49 -12.6999999999999993 - 74 -0 - 49 --6.3499999999999996 - 74 -0 - 0 -LTYPE - 5 -35 -100 -AcDbSymbolTableRecord -100 -AcDbLinetypeTableRecord - 2 -DASHED2 - 70 -0 - 3 -Dashed (.5x) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ - 72 -65 - 73 -2 - 40 -9.5250000000000004 - 49 -6.3499999999999996 - 74 -0 - 49 --3.1749999999999998 - 74 -0 - 0 -LTYPE - 5 -36 -100 -AcDbSymbolTableRecord -100 -AcDbLinetypeTableRecord - 2 -DASHEDX2 - 70 -0 - 3 -Dashed (2x) ____ ____ ____ ____ ____ ___ - 72 -65 - 73 -2 - 40 -38.1000000000000014 - 49 -25.3999999999999986 - 74 -0 - 49 --12.6999999999999993 - 74 -0 - 0 -LTYPE - 5 -37 -100 -AcDbSymbolTableRecord -100 -AcDbLinetypeTableRecord - 2 -DASHDOT - 70 -0 - 3 -Dash dot __ . __ . __ . __ . __ . __ . __ . __ - 72 -65 - 73 -4 - 40 -25.3999999999999986 - 49 -12.6999999999999993 - 74 -0 - 49 --6.3499999999999996 - 74 -0 - 49 -0.0 - 74 -0 - 49 --6.3499999999999996 - 74 -0 - 0 -LTYPE - 5 -38 -100 -AcDbSymbolTableRecord -100 -AcDbLinetypeTableRecord - 2 -DASHDOT2 - 70 -0 - 3 -Dash dot (.5x) _._._._._._._._._._._._._._._. - 72 -65 - 73 -4 - 40 -12.6999999999999993 - 49 -6.3499999999999996 - 74 -0 - 49 --3.1749999999999998 - 74 -0 - 49 -0.0 - 74 -0 - 49 --3.1749999999999998 - 74 -0 - 0 -LTYPE - 5 -39 -100 -AcDbSymbolTableRecord -100 -AcDbLinetypeTableRecord - 2 -DASHDOTX2 - 70 -0 - 3 -Dash dot (2x) ____ . ____ . ____ . ___ - 72 -65 - 73 -4 - 40 -50.7999999999999972 - 49 -25.3999999999999986 - 74 -0 - 49 --12.6999999999999993 - 74 -0 - 49 -0.0 - 74 -0 - 49 --12.6999999999999993 - 74 -0 - 0 -LTYPE - 5 -3A -100 -AcDbSymbolTableRecord -100 -AcDbLinetypeTableRecord - 2 -DIVIDE - 70 -0 - 3 -Divide ____ . . ____ . . ____ . . ____ . . ____ - 72 -65 - 73 -6 - 40 -31.75 - 49 -12.6999999999999993 - 74 -0 - 49 --6.3499999999999996 - 74 -0 - 49 -0.0 - 74 -0 - 49 --6.3499999999999996 - 74 -0 - 49 -0.0 - 74 -0 - 49 --6.3499999999999996 - 74 -0 - 0 -LTYPE - 5 -3B -100 -AcDbSymbolTableRecord -100 -AcDbLinetypeTableRecord - 2 -DIVIDE2 - 70 -0 - 3 -Divide (.5x) __..__..__..__..__..__..__..__.._ - 72 -65 - 73 -6 - 40 -15.875 - 49 -6.3499999999999996 - 74 -0 - 49 --3.1749999999999998 - 74 -0 - 49 -0.0 - 74 -0 - 49 --3.1749999999999998 - 74 -0 - 49 -0.0 - 74 -0 - 49 --3.1749999999999998 - 74 -0 - 0 -LTYPE - 5 -3C -100 -AcDbSymbolTableRecord -100 -AcDbLinetypeTableRecord - 2 -DIVIDEX2 - 70 -0 - 3 -Divide (2x) ________ . . ________ . . _ - 72 -65 - 73 -6 - 40 -63.5 - 49 -25.3999999999999986 - 74 -0 - 49 --12.6999999999999993 - 74 -0 - 49 -0.0 - 74 -0 - 49 --12.6999999999999993 - 74 -0 - 49 -0.0 - 74 -0 - 49 --12.6999999999999993 - 74 -0 - 0 -LTYPE - 5 -3D -100 -AcDbSymbolTableRecord -100 -AcDbLinetypeTableRecord - 2 -CENTER - 70 -0 - 3 -Center ____ _ ____ _ ____ _ ____ _ ____ _ ____ - 72 -65 - 73 -4 - 40 -50.7999999999999972 - 49 -31.75 - 74 -0 - 49 --6.3499999999999996 - 74 -0 - 49 -6.3499999999999996 - 74 -0 - 49 --6.3499999999999996 - 74 -0 - 0 -LTYPE - 5 -3E -100 -AcDbSymbolTableRecord -100 -AcDbLinetypeTableRecord - 2 -CENTER2 - 70 -0 - 3 -Center (.5x) ___ _ ___ _ ___ _ ___ _ ___ _ ___ - 72 -65 - 73 -4 - 40 -28.5749999999999993 - 49 -19.0500000000000007 - 74 -0 - 49 --3.1749999999999998 - 74 -0 - 49 -3.1749999999999998 - 74 -0 - 49 --3.1749999999999998 - 74 -0 - 0 -LTYPE - 5 -3F -100 -AcDbSymbolTableRecord -100 -AcDbLinetypeTableRecord - 2 -CENTERX2 - 70 -0 - 3 -Center (2x) ________ __ ________ __ _____ - 72 -65 - 73 -4 - 40 -101.5999999999999943 - 49 -63.5 - 74 -0 - 49 --12.6999999999999993 - 74 -0 - 49 -12.6999999999999993 - 74 -0 - 49 --12.6999999999999993 - 74 -0 - 0 -LTYPE - 5 -40 -100 -AcDbSymbolTableRecord -100 -AcDbLinetypeTableRecord - 2 -BORDER - 70 -0 - 3 -Border __ __ . __ __ . __ __ . __ __ . __ __ . - 72 -65 - 73 -6 - 40 -44.4500000000000028 - 49 -12.6999999999999993 - 74 -0 - 49 --6.3499999999999996 - 74 -0 - 49 -12.6999999999999993 - 74 -0 - 49 --6.3499999999999996 - 74 -0 - 49 -0.0 - 74 -0 - 49 --6.3499999999999996 - 74 -0 - 0 -LTYPE - 5 -41 -100 -AcDbSymbolTableRecord -100 -AcDbLinetypeTableRecord - 2 -BORDER2 - 70 -0 - 3 -Border (.5x) __.__.__.__.__.__.__.__.__.__.__. - 72 -65 - 73 -6 - 40 -22.2250000000000014 - 49 -6.3499999999999996 - 74 -0 - 49 --3.1749999999999998 - 74 -0 - 49 -6.3499999999999996 - 74 -0 - 49 --3.1749999999999998 - 74 -0 - 49 -0.0 - 74 -0 - 49 --3.1749999999999998 - 74 -0 - 0 -LTYPE - 5 -42 -100 -AcDbSymbolTableRecord -100 -AcDbLinetypeTableRecord - 2 -BORDERX2 - 70 -0 - 3 -Border (2x) ____ ____ . ____ ____ . ___ - 72 -65 - 73 -6 - 40 -88.9000000000000057 - 49 -25.3999999999999986 - 74 -0 - 49 --12.6999999999999993 - 74 -0 - 49 -25.3999999999999986 - 74 -0 - 49 --12.6999999999999993 - 74 -0 - 49 -0.0 - 74 -0 - 49 --12.6999999999999993 - 74 -0 - 0 -ENDTAB - 0 -TABLE - 2 -LAYER - 5 -2 -100 -AcDbSymbolTable - 70 -1 - 0 -LAYER - 5 -10 -100 -AcDbSymbolTableRecord -100 -AcDbLayerTableRecord - 2 -0 - 70 -0 - 62 -7 -420 -0 - 6 -CONTINUOUS -370 -25 -390 -F - 0 -ENDTAB - 0 -TABLE - 2 -STYLE - 5 -3 -100 -AcDbSymbolTable - 70 -1 - 0 -STYLE - 5 -11 -100 -AcDbSymbolTableRecord -100 -AcDbTextStyleTableRecord - 2 -Standard - 70 -0 - 40 -0.0 - 41 -0.75 - 50 -0.0 - 71 -0 - 42 -2.5 - 3 -txt - 4 - - 0 -ENDTAB - 0 -TABLE - 2 -VIEW - 5 -6 -100 -AcDbSymbolTable - 70 -0 - 0 -ENDTAB - 0 -TABLE - 2 -UCS - 5 -7 -100 -AcDbSymbolTable - 70 -0 - 0 -ENDTAB - 0 -TABLE - 2 -APPID - 5 -9 -100 -AcDbSymbolTable - 70 -1 - 0 -APPID - 5 -12 -100 -AcDbSymbolTableRecord -100 -AcDbRegAppTableRecord - 2 -ACAD - 70 -0 - 0 -ENDTAB - 0 -TABLE - 2 -DIMSTYLE - 5 -A -100 -AcDbSymbolTable - 70 -1 -100 -AcDbDimStyleTable - 71 -0 - 0 -DIMSTYLE -105 -27 -100 -AcDbSymbolTableRecord -100 -AcDbDimStyleTableRecord - 2 -Standard - 41 -2.5 - 42 -0.625 - 43 -3.75 - 44 -1.25 - 70 -0 - 73 -0 - 74 -0 - 77 -1 - 78 -8 -140 -2.5 -141 -2.5 -143 -0.03937007874016 -147 -0.625 -171 -3 -172 -1 -271 -2 -272 -2 -274 -3 -278 -44 -283 -0 -284 -8 -340 -11 - 0 -ENDTAB - 0 -TABLE - 2 -BLOCK_RECORD - 5 -1 -100 -AcDbSymbolTable - 70 -1 - 0 -BLOCK_RECORD - 5 -1F -100 -AcDbSymbolTableRecord -100 -AcDbBlockTableRecord - 2 -*Model_Space -340 -22 - 0 -BLOCK_RECORD - 5 -1B -100 -AcDbSymbolTableRecord -100 -AcDbBlockTableRecord - 2 -*Paper_Space -340 -1E - 0 -BLOCK_RECORD - 5 -23 -100 -AcDbSymbolTableRecord -100 -AcDbBlockTableRecord - 2 -*Paper_Space0 -340 -26 - 0 -BLOCK_RECORD - 5 -43 -100 -AcDbSymbolTableRecord -100 -AcDbBlockTableRecord - 2 -testblock -340 -0 - 0 -BLOCK_RECORD - 5 -44 -100 -AcDbSymbolTableRecord -100 -AcDbBlockTableRecord - 2 -testblock2 -340 -0 - 0 -ENDTAB - 0 -ENDSEC - 0 -SECTION - 2 -BLOCKS - 0 -BLOCK - 5 -20 -100 -AcDbEntity - 8 -0 -100 -AcDbBlockBegin - 2 -*Model_Space - 70 -0 - 10 -0.0 - 20 -0.0 - 30 -0.0 - 3 -*Model_Space - 1 - - 0 -ENDBLK - 5 -21 -100 -AcDbEntity - 8 -0 -100 -AcDbBlockEnd - 0 -BLOCK - 5 -1C -100 -AcDbEntity - 67 -1 - 8 -0 -100 -AcDbBlockBegin - 2 -*Paper_Space - 70 -0 - 10 -0.0 - 20 -0.0 - 30 -0.0 - 3 -*Paper_Space - 1 - - 0 -ENDBLK - 5 -1D -100 -AcDbEntity - 67 -1 - 8 -0 -100 -AcDbBlockEnd - 0 -BLOCK - 5 -24 -100 -AcDbEntity - 8 -0 -100 -AcDbBlockBegin - 2 -*Paper_Space0 - 70 -0 - 10 -0.0 - 20 -0.0 - 30 -0.0 - 3 -*Paper_Space0 - 1 - - 0 -ENDBLK - 5 -25 -100 -AcDbEntity - 8 -0 -100 -AcDbBlockEnd - 0 -BLOCK - 5 -45 -100 -AcDbEntity - 8 -0 -100 -AcDbBlockBegin - 2 -testblock - 70 -0 - 10 -0.0 - 20 -0.0 - 30 -0.0 - 3 -testblock - 1 - - 0 -LINE - 5 -46 -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 --1.0 - 20 -0.0 - 30 -0.0 - 11 --1.0 - 21 -2.0 - 31 -0.0 - 0 -LINE - 5 -47 -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 --1.0 - 20 -2.0 - 30 -0.0 - 11 --3.0 - 21 -2.0 - 31 -0.0 - 0 -LINE - 5 -48 -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 --3.0 - 20 -2.0 - 30 -0.0 - 11 --3.0 - 21 -4.0 - 31 -0.0 - 0 -LINE - 5 -49 -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 --3.0 - 20 -4.0 - 30 -0.0 - 11 -3.0 - 21 -4.0 - 31 -0.0 - 0 -LINE - 5 -4A -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 -3.0 - 20 -4.0 - 30 -0.0 - 11 -3.0 - 21 -2.0 - 31 -0.0 - 0 -LINE - 5 -4B -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 -3.0 - 20 -2.0 - 30 -0.0 - 11 -1.0 - 21 -2.0 - 31 -0.0 - 0 -LINE - 5 -4C -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 -1.0 - 20 -2.0 - 30 -0.0 - 11 -1.0 - 21 -0.0 - 31 -0.0 - 0 -ENDBLK - 5 -4D -100 -AcDbEntity - 8 -0 -100 -AcDbBlockEnd - 0 -BLOCK - 5 -4E -100 -AcDbEntity - 8 -0 -100 -AcDbBlockBegin - 2 -testblock2 - 70 -0 - 10 -0.0 - 20 -0.0 - 30 -0.0 - 3 -testblock2 - 1 - - 0 -LINE - 5 -4F -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 --1.0000000000000004 - 20 -6.0 - 30 -0.0 - 11 --1.0 - 21 -8.0 - 31 -0.0 - 0 -LINE - 5 -50 -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 --1.0 - 20 -8.0 - 30 -0.0 - 11 --3.0 - 21 -8.0 - 31 -0.0 - 0 -LINE - 5 -51 -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 --3.0 - 20 -8.0 - 30 -0.0 - 11 --3.0 - 21 -10.0 - 31 -0.0 - 0 -LINE - 5 -52 -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 --3.0 - 20 -10.0 - 30 -0.0 - 11 -3.0 - 21 -10.0 - 31 -0.0 - 0 -LINE - 5 -53 -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 -3.0 - 20 -10.0 - 30 -0.0 - 11 -3.0 - 21 -8.0 - 31 -0.0 - 0 -LINE - 5 -54 -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 -3.0 - 20 -8.0 - 30 -0.0 - 11 -1.0 - 21 -8.0 - 31 -0.0 - 0 -LINE - 5 -55 -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 -1.0 - 20 -8.0 - 30 -0.0 - 11 -0.9999999999999998 - 21 -6.0 - 31 -0.0 - 0 -ENDBLK - 5 -56 -100 -AcDbEntity - 8 -0 -100 -AcDbBlockEnd - 0 -ENDSEC - 0 -SECTION - 2 -ENTITIES - 0 -LINE - 5 -57 -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 -10.0 - 20 -10.0 - 30 -0.0 - 11 -10.0 - 21 --10.0 - 31 -0.0 - 0 -LINE - 5 -58 -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 --10.0 - 20 --10.0 - 30 -0.0 - 11 --10.0 - 21 -10.0 - 31 -0.0 - 0 -LINE - 5 -59 -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 --10.0 - 20 -10.0 - 30 -0.0 - 11 --1.0 - 21 -10.0 - 31 -0.0 - 0 -LINE - 5 -5A -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 -1.0 - 20 -10.0 - 30 -0.0 - 11 -10.0 - 21 -10.0 - 31 -0.0 - 0 -LINE - 5 -5B -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 -10.0 - 20 --10.0 - 30 -0.0 - 11 -1.0 - 21 --10.0 - 31 -0.0 - 0 -LINE - 5 -5C -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 --1.0 - 20 --10.0 - 30 -0.0 - 11 --10.0 - 21 --10.0 - 31 -0.0 - 0 -LINE - 5 -5D -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 -40.0 - 20 -10.0 - 30 -0.0 - 11 -40.0 - 21 --10.0 - 31 -0.0 - 0 -LINE - 5 -5E -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 -20.0 - 20 --10.0 - 30 -0.0 - 11 -20.0 - 21 -10.0 - 31 -0.0 - 0 -LINE - 5 -5F -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 -20.0 - 20 -10.0 - 30 -0.0 - 11 -29.0 - 21 -10.0 - 31 -0.0 - 0 -LINE - 5 -60 -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 -31.0 - 20 -10.0 - 30 -0.0 - 11 -40.0 - 21 -10.0 - 31 -0.0 - 0 -LINE - 5 -61 -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 -40.0 - 20 --10.0 - 30 -0.0 - 11 -31.0 - 21 --10.0 - 31 -0.0 - 0 -LINE - 5 -62 -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 -29.0 - 20 --10.0 - 30 -0.0 - 11 -20.0 - 21 --10.0 - 31 -0.0 - 0 -INSERT - 5 -63 -100 -AcDbEntity -100 -AcDbBlockReference - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 2 -testblock2 - 10 -29.9999999999999964 - 20 --4.0 - 30 -0.0 - 41 -1.0 - 42 --1.0 - 43 -1.0 - 50 -360.0 - 44 -1.0 - 45 -1.0 - 0 -INSERT - 5 -64 -100 -AcDbEntity -100 -AcDbBlockReference - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 2 -testblock2 - 10 -30.0 - 20 -4.0 - 30 -0.0 - 44 -1.0 - 45 -1.0 - 0 -INSERT - 5 -65 -100 -AcDbEntity -100 -AcDbBlockReference - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 2 -testblock - 10 -0.0 - 20 --10.0 - 30 -0.0 - 41 -1.0 - 42 --1.0 - 43 -1.0 - 50 -360.0 - 44 -1.0 - 45 -1.0 - 0 -INSERT - 5 -66 -100 -AcDbEntity -100 -AcDbBlockReference - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 2 -testblock - 10 -0.0 - 20 -10.0 - 30 -0.0 - 44 -1.0 - 45 -1.0 - 0 -LINE - 5 -67 -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 -60.0 - 20 -7.0710678118654755 - 30 -0.0 - 11 -67.0710678118654755 - 21 --0.0000000000000017 - 31 -0.0 - 0 -LINE - 5 -68 -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 -60.0 - 20 --7.0710678118654755 - 30 -0.0 - 11 -52.9289321881345245 - 21 -0.0000000000000009 - 31 -0.0 - 0 -LINE - 5 -69 -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 -52.9289321881345245 - 20 -0.0000000000000009 - 30 -0.0 - 11 -56.1109127034739927 - 21 -3.1819805153394651 - 31 -0.0 - 0 -LINE - 5 -6A -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 -56.8180194846605389 - 20 -3.8890872965260113 - 30 -0.0 - 11 -60.0 - 21 -7.0710678118654755 - 31 -0.0 - 0 -LINE - 5 -6B -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 -67.0710678118654755 - 20 --0.0000000000000017 - 30 -0.0 - 11 -63.8890872965260073 - 21 --3.1819805153394651 - 31 -0.0 - 0 -LINE - 5 -6C -100 -AcDbEntity -100 -AcDbLine - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 10 -63.1819805153394611 - 20 --3.8890872965260117 - 30 -0.0 - 11 -60.0 - 21 --7.0710678118654755 - 31 -0.0 - 0 -INSERT - 5 -6D -100 -AcDbEntity -100 -AcDbBlockReference - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 2 -testblock2 - 10 -58.5857864376269077 - 20 -1.4142135623730963 - 30 -0.0 - 41 -0.5 - 42 -0.5 - 43 -1.0 - 50 -45.0 - 44 -1.0 - 45 -1.0 - 0 -INSERT - 5 -6E -100 -AcDbEntity -100 -AcDbBlockReference - 8 -0 - 62 -256 -370 --1 - 6 -ByLayer - 2 -testblock2 - 10 -61.4142135623730923 - 20 --1.4142135623730949 - 30 -0.0 - 41 -0.5 - 42 -0.5 - 43 -1.0 - 50 --135.0 - 44 -1.0 - 45 -1.0 - 0 -ENDSEC - 0 -SECTION - 2 -OBJECTS - 0 -DICTIONARY - 5 -C -100 -AcDbDictionary -280 -0 -281 -1 - 3 -ACAD_GROUP -350 -D - 3 -ACAD_LAYOUT -350 -1A - 3 -ACAD_MLINESTYLE -350 -17 - 3 -ACAD_PLOTSETTINGS -350 -19 - 3 -ACAD_PLOTSTYLENAME -350 -E - 3 -AcDbVariableDictionary -350 -6F - 0 -DICTIONARY - 5 -D -100 -AcDbDictionary -280 -0 -281 -1 - 0 -ACDBDICTIONARYWDFLT - 5 -E -100 -AcDbDictionary -281 -1 - 3 -Normal -350 -F -100 -AcDbDictionaryWithDefault -340 -F - 0 -ACDBPLACEHOLDER - 5 -F - 0 -DICTIONARY - 5 -17 -100 -AcDbDictionary -280 -0 -281 -1 - 3 -Standard -350 -18 - 0 -MLINESTYLE - 5 -18 -100 -AcDbMlineStyle - 2 -STANDARD - 70 -0 - 3 - - 62 -256 - 51 -90.0 - 52 -90.0 - 71 -2 - 49 -0.5 - 62 -256 - 6 -BYLAYER - 49 --0.5 - 62 -256 - 6 -BYLAYER - 0 -DICTIONARY - 5 -19 -100 -AcDbDictionary -280 -0 -281 -1 - 0 -DICTIONARY - 5 -1A -100 -AcDbDictionary -281 -1 - 3 -Layout1 -350 -1E - 3 -Layout2 -350 -26 - 3 -Model -350 -22 - 0 -LAYOUT - 5 -1E -100 -AcDbPlotSettings - 1 - - 2 -C:\Program Files\AutoCAD 2002\plotters\DWF ePlot (optimized for plotting).pc3 - 4 - - 6 - - 40 -0.0 - 41 -0.0 - 42 -0.0 - 43 -0.0 - 44 -0.0 - 45 -0.0 - 46 -0.0 - 47 -0.0 - 48 -0.0 - 49 -0.0 -140 -0.0 -141 -0.0 -142 -1.0 -143 -1.0 - 70 -688 - 72 -0 - 73 -0 - 74 -5 - 7 - - 75 -16 -147 -1.0 -148 -0.0 -149 -0.0 -100 -AcDbLayout - 1 -Layout1 - 70 -1 - 71 -1 - 10 -0.0 - 20 -0.0 - 11 -420.0 - 21 -297.0 - 12 -0.0 - 22 -0.0 - 32 -0.0 - 14 -100000000000000000000.0 - 24 -100000000000000000000.0 - 34 -100000000000000000000.0 - 15 --100000000000000000000.0 - 25 --100000000000000000000.0 - 35 --100000000000000000000.0 -146 -0.0 - 13 -0.0 - 23 -0.0 - 33 -0.0 - 16 -1.0 - 26 -0.0 - 36 -0.0 - 17 -0.0 - 27 -1.0 - 37 -0.0 - 76 -0 -330 -1B - 0 -LAYOUT - 5 -22 -100 -AcDbPlotSettings - 1 - - 2 -C:\Program Files\AutoCAD 2002\plotters\DWF ePlot (optimized for plotting).pc3 - 4 - - 6 - - 40 -0.0 - 41 -0.0 - 42 -0.0 - 43 -0.0 - 44 -0.0 - 45 -0.0 - 46 -0.0 - 47 -0.0 - 48 -0.0 - 49 -0.0 -140 -0.0 -141 -0.0 -142 -1.0 -143 -1.0 - 70 -1712 - 72 -0 - 73 -0 - 74 -0 - 7 - - 75 -0 -147 -1.0 -148 -0.0 -149 -0.0 -100 -AcDbLayout - 1 -Model - 70 -1 - 71 -0 - 10 -0.0 - 20 -0.0 - 11 -12.0 - 21 -9.0 - 12 -0.0 - 22 -0.0 - 32 -0.0 - 14 -0.0 - 24 -0.0 - 34 -0.0 - 15 -0.0 - 25 -0.0 - 35 -0.0 -146 -0.0 - 13 -0.0 - 23 -0.0 - 33 -0.0 - 16 -1.0 - 26 -0.0 - 36 -0.0 - 17 -0.0 - 27 -1.0 - 37 -0.0 - 76 -0 -330 -1F - 0 -LAYOUT - 5 -26 -100 -AcDbPlotSettings - 1 - - 2 -C:\Program Files\AutoCAD 2002\plotters\DWF ePlot (optimized for plotting).pc3 - 4 - - 6 - - 40 -0.0 - 41 -0.0 - 42 -0.0 - 43 -0.0 - 44 -0.0 - 45 -0.0 - 46 -0.0 - 47 -0.0 - 48 -0.0 - 49 -0.0 -140 -0.0 -141 -0.0 -142 -1.0 -143 -1.0 - 70 -688 - 72 -0 - 73 -0 - 74 -5 - 7 - - 75 -16 -147 -1.0 -148 -0.0 -149 -0.0 -100 -AcDbLayout - 1 -Layout2 - 70 -1 - 71 -2 - 10 -0.0 - 20 -0.0 - 11 -12.0 - 21 -9.0 - 12 -0.0 - 22 -0.0 - 32 -0.0 - 14 -0.0 - 24 -0.0 - 34 -0.0 - 15 -0.0 - 25 -0.0 - 35 -0.0 -146 -0.0 - 13 -0.0 - 23 -0.0 - 33 -0.0 - 16 -1.0 - 26 -0.0 - 36 -0.0 - 17 -0.0 - 27 -1.0 - 37 -0.0 - 76 -0 -330 -23 - 0 -DICTIONARY - 5 -6F -100 -AcDbDictionary -281 -1 - 3 -DIMASSOC -350 -71 - 3 -HIDETEXT -350 -70 - 0 -DICTIONARYVAR - 5 -70 -100 -DictionaryVariables -280 -0 - 1 -2 - 0 -DICTIONARYVAR - 5 -71 -100 -DictionaryVariables -280 -0 - 1 -1 - 0 -ENDSEC - 0 -EOF diff --git a/testdata/scad/minimal/transform-insert.scad b/testdata/scad/minimal/transform-insert.scad deleted file mode 100644 index 1237bb2..0000000 --- a/testdata/scad/minimal/transform-insert.scad +++ /dev/null @@ -1 +0,0 @@ -import_dxf("transform-insert.dxf"); diff --git a/tests/regression/csgtermtest/transform-insert-expected.txt b/tests/regression/csgtermtest/transform-insert-expected.txt deleted file mode 100644 index 847d6c3..0000000 --- a/tests/regression/csgtermtest/transform-insert-expected.txt +++ /dev/null @@ -1 +0,0 @@ -import2 diff --git a/tests/regression/csgtexttest/transform-insert-expected.txt b/tests/regression/csgtexttest/transform-insert-expected.txt deleted file mode 100644 index a673ddb..0000000 --- a/tests/regression/csgtexttest/transform-insert-expected.txt +++ /dev/null @@ -1 +0,0 @@ -group1(import) diff --git a/tests/regression/dumptest/transform-insert-expected.txt b/tests/regression/dumptest/transform-insert-expected.txt deleted file mode 100644 index 758c9e1..0000000 --- a/tests/regression/dumptest/transform-insert-expected.txt +++ /dev/null @@ -1,3 +0,0 @@ -group() { - import_dxf(file = "/Users/kintel/code/OpenSCAD/openscad-visitor/testdata/scad/minimal/transform-insert.dxf", cache = "4e39fca1.4329", layer = "", origin = [ 0 0 ], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 1); -} -- cgit v0.10.1 From cdbf45eea06004cd619831e38609f7ec8455b74a Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Fri, 30 Sep 2011 19:04:08 +0200 Subject: Removed unused variable diff --git a/src/import.cc b/src/import.cc index f64a8f6..d86a60d 100644 --- a/src/import.cc +++ b/src/import.cc @@ -228,7 +228,6 @@ std::string ImportNode::toString() const { std::stringstream stream; - QString text; struct stat st; memset(&st, 0, sizeof(struct stat)); stat(this->filename.c_str(), &st); -- cgit v0.10.1 From 831165281979f77d0c17bbb85919652e5800266b Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Sat, 1 Oct 2011 00:42:29 +0200 Subject: Use new form of import() diff --git a/testdata/scad/dxf/transform-insert.scad b/testdata/scad/dxf/transform-insert.scad index 28595a3..22a0132 100644 --- a/testdata/scad/dxf/transform-insert.scad +++ b/testdata/scad/dxf/transform-insert.scad @@ -1 +1 @@ -import_dxf("../../dxf/transform-insert.dxf"); +import("../../dxf/transform-insert.dxf"); -- cgit v0.10.1 From 2601d468e354b7d99821781edcd749daefa8c331 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Sat, 1 Oct 2011 00:43:38 +0200 Subject: Added dxf test cases diff --git a/testdata/scad/dxf/arc.scad b/testdata/scad/dxf/arc.scad new file mode 100644 index 0000000..fff70a3 --- /dev/null +++ b/testdata/scad/dxf/arc.scad @@ -0,0 +1 @@ +import("../../dxf/arc.dxf"); diff --git a/testdata/scad/dxf/circle-advanced.scad b/testdata/scad/dxf/circle-advanced.scad new file mode 100644 index 0000000..801ea05 --- /dev/null +++ b/testdata/scad/dxf/circle-advanced.scad @@ -0,0 +1 @@ +import("../../dxf/circle-advanced.dxf"); diff --git a/testdata/scad/dxf/circle-double.scad b/testdata/scad/dxf/circle-double.scad new file mode 100644 index 0000000..095c785 --- /dev/null +++ b/testdata/scad/dxf/circle-double.scad @@ -0,0 +1 @@ +import("../../dxf/circle-double.dxf"); diff --git a/testdata/scad/dxf/circle-small.scad b/testdata/scad/dxf/circle-small.scad new file mode 100644 index 0000000..94f5fa4 --- /dev/null +++ b/testdata/scad/dxf/circle-small.scad @@ -0,0 +1 @@ +import("../../dxf/circle-small.dxf"); diff --git a/testdata/scad/dxf/circle.scad b/testdata/scad/dxf/circle.scad new file mode 100644 index 0000000..8b5d132 --- /dev/null +++ b/testdata/scad/dxf/circle.scad @@ -0,0 +1 @@ +import("../../dxf/circle.dxf"); diff --git a/testdata/scad/dxf/ellipse-arc-rot.scad b/testdata/scad/dxf/ellipse-arc-rot.scad new file mode 100644 index 0000000..4b3b603 --- /dev/null +++ b/testdata/scad/dxf/ellipse-arc-rot.scad @@ -0,0 +1 @@ +import("../../dxf/ellipse-arc-rot.dxf"); diff --git a/testdata/scad/dxf/ellipse-arc.scad b/testdata/scad/dxf/ellipse-arc.scad new file mode 100644 index 0000000..4a43a16 --- /dev/null +++ b/testdata/scad/dxf/ellipse-arc.scad @@ -0,0 +1 @@ +import("../../dxf/ellipse-arc.dxf"); diff --git a/testdata/scad/dxf/ellipse-reverse.scad b/testdata/scad/dxf/ellipse-reverse.scad new file mode 100644 index 0000000..646a74a --- /dev/null +++ b/testdata/scad/dxf/ellipse-reverse.scad @@ -0,0 +1 @@ +import("../../dxf/ellipse-reverse.dxf"); diff --git a/testdata/scad/dxf/ellipse-rot.scad b/testdata/scad/dxf/ellipse-rot.scad new file mode 100644 index 0000000..f2c872f --- /dev/null +++ b/testdata/scad/dxf/ellipse-rot.scad @@ -0,0 +1 @@ +import("../../dxf/ellipse-rot.dxf"); diff --git a/testdata/scad/dxf/ellipse.scad b/testdata/scad/dxf/ellipse.scad new file mode 100644 index 0000000..5b56d35 --- /dev/null +++ b/testdata/scad/dxf/ellipse.scad @@ -0,0 +1 @@ +import("../../dxf/ellipse.dxf"); diff --git a/testdata/scad/dxf/lwpolyline-closed.scad b/testdata/scad/dxf/lwpolyline-closed.scad new file mode 100644 index 0000000..8408ac8 --- /dev/null +++ b/testdata/scad/dxf/lwpolyline-closed.scad @@ -0,0 +1 @@ +import("../../dxf/lwpolyline-closed.dxf"); diff --git a/testdata/scad/dxf/lwpolyline.scad b/testdata/scad/dxf/lwpolyline.scad new file mode 100644 index 0000000..0a50787 --- /dev/null +++ b/testdata/scad/dxf/lwpolyline.scad @@ -0,0 +1 @@ +import("../../dxf/lwpolyline.dxf"); diff --git a/testdata/scad/dxf/lwpolyline2.scad b/testdata/scad/dxf/lwpolyline2.scad new file mode 100644 index 0000000..c0bf16c --- /dev/null +++ b/testdata/scad/dxf/lwpolyline2.scad @@ -0,0 +1 @@ +import("../../dxf/lwpolyline2.dxf"); diff --git a/testdata/scad/dxf/multiple-layers.scad b/testdata/scad/dxf/multiple-layers.scad new file mode 100644 index 0000000..f32fdb1 --- /dev/null +++ b/testdata/scad/dxf/multiple-layers.scad @@ -0,0 +1 @@ +import("../../dxf/multiple-layers.dxf"); diff --git a/testdata/scad/dxf/polygon-concave-hole.scad b/testdata/scad/dxf/polygon-concave-hole.scad new file mode 100644 index 0000000..65ee56f --- /dev/null +++ b/testdata/scad/dxf/polygon-concave-hole.scad @@ -0,0 +1 @@ +import("../../dxf/polygon-concave-hole.dxf"); diff --git a/testdata/scad/dxf/polygon-concave-simple.scad b/testdata/scad/dxf/polygon-concave-simple.scad new file mode 100644 index 0000000..8f9ad18 --- /dev/null +++ b/testdata/scad/dxf/polygon-concave-simple.scad @@ -0,0 +1 @@ +import("../../dxf/polygon-concave-simple.dxf"); diff --git a/testdata/scad/dxf/polygon-concave.scad b/testdata/scad/dxf/polygon-concave.scad new file mode 100644 index 0000000..13db93c --- /dev/null +++ b/testdata/scad/dxf/polygon-concave.scad @@ -0,0 +1 @@ +import("../../dxf/polygon-concave.dxf"); diff --git a/testdata/scad/dxf/polygon-holes-touch.scad b/testdata/scad/dxf/polygon-holes-touch.scad new file mode 100644 index 0000000..f716bb9 --- /dev/null +++ b/testdata/scad/dxf/polygon-holes-touch.scad @@ -0,0 +1 @@ +import("../../dxf/polygon-holes-touch.dxf"); diff --git a/testdata/scad/dxf/polygon-intersect.scad b/testdata/scad/dxf/polygon-intersect.scad new file mode 100644 index 0000000..a1060fa --- /dev/null +++ b/testdata/scad/dxf/polygon-intersect.scad @@ -0,0 +1 @@ +import("../../dxf/polygon-intersect.dxf"); diff --git a/testdata/scad/dxf/polygon-many-holes.scad b/testdata/scad/dxf/polygon-many-holes.scad new file mode 100644 index 0000000..0ea3324 --- /dev/null +++ b/testdata/scad/dxf/polygon-many-holes.scad @@ -0,0 +1 @@ +import("../../dxf/polygon-many-holes.dxf"); diff --git a/testdata/scad/dxf/polygon-mesh.scad b/testdata/scad/dxf/polygon-mesh.scad new file mode 100644 index 0000000..af3e372 --- /dev/null +++ b/testdata/scad/dxf/polygon-mesh.scad @@ -0,0 +1 @@ +import("../../dxf/polygon-mesh.dxf"); diff --git a/testdata/scad/dxf/polygon-overlap.scad b/testdata/scad/dxf/polygon-overlap.scad new file mode 100644 index 0000000..2958f5a --- /dev/null +++ b/testdata/scad/dxf/polygon-overlap.scad @@ -0,0 +1 @@ +import("../../dxf/polygon-overlap.dxf"); diff --git a/testdata/scad/dxf/polygon-riser.scad b/testdata/scad/dxf/polygon-riser.scad new file mode 100644 index 0000000..7607258 --- /dev/null +++ b/testdata/scad/dxf/polygon-riser.scad @@ -0,0 +1 @@ +import("../../dxf/polygon-riser.dxf"); diff --git a/testdata/scad/dxf/polygon-self-intersect.scad b/testdata/scad/dxf/polygon-self-intersect.scad new file mode 100644 index 0000000..e4764b3 --- /dev/null +++ b/testdata/scad/dxf/polygon-self-intersect.scad @@ -0,0 +1 @@ +import("../../dxf/polygon-self-intersect.dxf"); diff --git a/testdata/scad/dxf/polygon8.scad b/testdata/scad/dxf/polygon8.scad new file mode 100644 index 0000000..d17a77a --- /dev/null +++ b/testdata/scad/dxf/polygon8.scad @@ -0,0 +1 @@ +import("../../dxf/polygon8.dxf"); diff --git a/testdata/scad/dxf/polygons.scad b/testdata/scad/dxf/polygons.scad new file mode 100644 index 0000000..90fe14b --- /dev/null +++ b/testdata/scad/dxf/polygons.scad @@ -0,0 +1 @@ +import("../../dxf/polygons.dxf"); diff --git a/testdata/scad/dxf/triangle-with-duplicate-vertex.scad b/testdata/scad/dxf/triangle-with-duplicate-vertex.scad new file mode 100644 index 0000000..d7dfe74 --- /dev/null +++ b/testdata/scad/dxf/triangle-with-duplicate-vertex.scad @@ -0,0 +1 @@ +import("../../dxf/triangle-with-duplicate-vertex.dxf"); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 606878a..3a59c3e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -193,6 +193,7 @@ enable_testing() file(GLOB MINIMAL_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/minimal/*.scad) file(GLOB FEATURES_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/features/*.scad) file(GLOB BUGS_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/*.scad) +file(GLOB SCAD_DXF_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/dxf/*.scad) # Add dumptest tests to CTest add_cmdline_test(dumptest txt ${MINIMAL_FILES}) @@ -239,6 +240,7 @@ LIST(APPEND CGALPNGTEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/features/include-tests.scad ${CMAKE_SOURCE_DIR}/../testdata/scad/features/child-tests.scad ${CMAKE_SOURCE_DIR}/../testdata/scad/features/ifelse-tests.scad) +LIST(APPEND CGALPNGTEST_FILES ${SCAD_DXF_FILES}) #LIST(APPEND CGALPNGTEST_FILES ${CMAKE_SOURCE_DIR}/../examples/example001.scad) add_cmdline_test(cgalpngtest png ${CGALPNGTEST_FILES}) @@ -247,6 +249,7 @@ LIST(APPEND OPENCSGTEST_FILES ${CGALPNGTEST_FILES}) LIST(APPEND OPENCSGTEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/features/highlight-and-background-modifier.scad ${CMAKE_SOURCE_DIR}/../testdata/scad/features/child-background.scad) +LIST(APPEND OPENCSGTEST_FILES ${SCAD_DXF_FILES}) add_cmdline_test(opencsgtest png ${OPENCSGTEST_FILES}) # Add dxfexport tests to CTest diff --git a/tests/regression/cgalpngtest/arc-expected.png b/tests/regression/cgalpngtest/arc-expected.png new file mode 100644 index 0000000..2f555c4 Binary files /dev/null and b/tests/regression/cgalpngtest/arc-expected.png differ diff --git a/tests/regression/cgalpngtest/circle-advanced-expected.png b/tests/regression/cgalpngtest/circle-advanced-expected.png new file mode 100644 index 0000000..3b31c78 Binary files /dev/null and b/tests/regression/cgalpngtest/circle-advanced-expected.png differ diff --git a/tests/regression/cgalpngtest/circle-double-expected.png b/tests/regression/cgalpngtest/circle-double-expected.png new file mode 100644 index 0000000..17e6b39 Binary files /dev/null and b/tests/regression/cgalpngtest/circle-double-expected.png differ diff --git a/tests/regression/cgalpngtest/circle-expected.png b/tests/regression/cgalpngtest/circle-expected.png new file mode 100644 index 0000000..aacf12d Binary files /dev/null and b/tests/regression/cgalpngtest/circle-expected.png differ diff --git a/tests/regression/cgalpngtest/circle-small-expected.png b/tests/regression/cgalpngtest/circle-small-expected.png new file mode 100644 index 0000000..bc2a75b Binary files /dev/null and b/tests/regression/cgalpngtest/circle-small-expected.png differ diff --git a/tests/regression/cgalpngtest/ellipse-arc-expected.png b/tests/regression/cgalpngtest/ellipse-arc-expected.png new file mode 100644 index 0000000..561619b Binary files /dev/null and b/tests/regression/cgalpngtest/ellipse-arc-expected.png differ diff --git a/tests/regression/cgalpngtest/ellipse-arc-rot-expected.png b/tests/regression/cgalpngtest/ellipse-arc-rot-expected.png new file mode 100644 index 0000000..7a2ef89 Binary files /dev/null and b/tests/regression/cgalpngtest/ellipse-arc-rot-expected.png differ diff --git a/tests/regression/cgalpngtest/ellipse-expected.png b/tests/regression/cgalpngtest/ellipse-expected.png new file mode 100644 index 0000000..384cb6b Binary files /dev/null and b/tests/regression/cgalpngtest/ellipse-expected.png differ diff --git a/tests/regression/cgalpngtest/ellipse-reverse-expected.png b/tests/regression/cgalpngtest/ellipse-reverse-expected.png new file mode 100644 index 0000000..e5a7b10 Binary files /dev/null and b/tests/regression/cgalpngtest/ellipse-reverse-expected.png differ diff --git a/tests/regression/cgalpngtest/ellipse-rot-expected.png b/tests/regression/cgalpngtest/ellipse-rot-expected.png new file mode 100644 index 0000000..2c68ae2 Binary files /dev/null and b/tests/regression/cgalpngtest/ellipse-rot-expected.png differ diff --git a/tests/regression/cgalpngtest/lwpolyline-closed-expected.png b/tests/regression/cgalpngtest/lwpolyline-closed-expected.png new file mode 100644 index 0000000..d0376c9 Binary files /dev/null and b/tests/regression/cgalpngtest/lwpolyline-closed-expected.png differ diff --git a/tests/regression/cgalpngtest/lwpolyline-expected.png b/tests/regression/cgalpngtest/lwpolyline-expected.png new file mode 100644 index 0000000..d0376c9 Binary files /dev/null and b/tests/regression/cgalpngtest/lwpolyline-expected.png differ diff --git a/tests/regression/cgalpngtest/lwpolyline2-expected.png b/tests/regression/cgalpngtest/lwpolyline2-expected.png new file mode 100644 index 0000000..f01f339 Binary files /dev/null and b/tests/regression/cgalpngtest/lwpolyline2-expected.png differ diff --git a/tests/regression/cgalpngtest/multiple-layers-expected.png b/tests/regression/cgalpngtest/multiple-layers-expected.png new file mode 100644 index 0000000..680729b Binary files /dev/null and b/tests/regression/cgalpngtest/multiple-layers-expected.png differ diff --git a/tests/regression/cgalpngtest/polygon-concave-expected.png b/tests/regression/cgalpngtest/polygon-concave-expected.png new file mode 100644 index 0000000..e1c68ef Binary files /dev/null and b/tests/regression/cgalpngtest/polygon-concave-expected.png differ diff --git a/tests/regression/cgalpngtest/polygon-concave-hole-expected.png b/tests/regression/cgalpngtest/polygon-concave-hole-expected.png new file mode 100644 index 0000000..eb11557 Binary files /dev/null and b/tests/regression/cgalpngtest/polygon-concave-hole-expected.png differ diff --git a/tests/regression/cgalpngtest/polygon-concave-simple-expected.png b/tests/regression/cgalpngtest/polygon-concave-simple-expected.png new file mode 100644 index 0000000..14808ca Binary files /dev/null and b/tests/regression/cgalpngtest/polygon-concave-simple-expected.png differ diff --git a/tests/regression/cgalpngtest/polygon-holes-touch-expected.png b/tests/regression/cgalpngtest/polygon-holes-touch-expected.png new file mode 100644 index 0000000..ef2507c Binary files /dev/null and b/tests/regression/cgalpngtest/polygon-holes-touch-expected.png differ diff --git a/tests/regression/cgalpngtest/polygon-intersect-expected.png b/tests/regression/cgalpngtest/polygon-intersect-expected.png new file mode 100644 index 0000000..6f4f437 Binary files /dev/null and b/tests/regression/cgalpngtest/polygon-intersect-expected.png differ diff --git a/tests/regression/cgalpngtest/polygon-many-holes-expected.png b/tests/regression/cgalpngtest/polygon-many-holes-expected.png new file mode 100644 index 0000000..2527af9 Binary files /dev/null and b/tests/regression/cgalpngtest/polygon-many-holes-expected.png differ diff --git a/tests/regression/cgalpngtest/polygon-mesh-expected.png b/tests/regression/cgalpngtest/polygon-mesh-expected.png new file mode 100644 index 0000000..6f4f437 Binary files /dev/null and b/tests/regression/cgalpngtest/polygon-mesh-expected.png differ diff --git a/tests/regression/cgalpngtest/polygon-overlap-expected.png b/tests/regression/cgalpngtest/polygon-overlap-expected.png new file mode 100644 index 0000000..6f4f437 Binary files /dev/null and b/tests/regression/cgalpngtest/polygon-overlap-expected.png differ diff --git a/tests/regression/cgalpngtest/polygon-riser-expected.png b/tests/regression/cgalpngtest/polygon-riser-expected.png new file mode 100644 index 0000000..ce9ca69 Binary files /dev/null and b/tests/regression/cgalpngtest/polygon-riser-expected.png differ diff --git a/tests/regression/cgalpngtest/polygon-self-intersect-expected.png b/tests/regression/cgalpngtest/polygon-self-intersect-expected.png new file mode 100644 index 0000000..6f4f437 Binary files /dev/null and b/tests/regression/cgalpngtest/polygon-self-intersect-expected.png differ diff --git a/tests/regression/cgalpngtest/polygon8-expected.png b/tests/regression/cgalpngtest/polygon8-expected.png new file mode 100644 index 0000000..8b480c0 Binary files /dev/null and b/tests/regression/cgalpngtest/polygon8-expected.png differ diff --git a/tests/regression/cgalpngtest/polygons-expected.png b/tests/regression/cgalpngtest/polygons-expected.png new file mode 100644 index 0000000..a30fcb6 Binary files /dev/null and b/tests/regression/cgalpngtest/polygons-expected.png differ diff --git a/tests/regression/cgalpngtest/transform-insert-expected.png b/tests/regression/cgalpngtest/transform-insert-expected.png new file mode 100644 index 0000000..12867cc Binary files /dev/null and b/tests/regression/cgalpngtest/transform-insert-expected.png differ diff --git a/tests/regression/cgalpngtest/triangle-with-duplicate-vertex-expected.png b/tests/regression/cgalpngtest/triangle-with-duplicate-vertex-expected.png new file mode 100644 index 0000000..8dd4de0 Binary files /dev/null and b/tests/regression/cgalpngtest/triangle-with-duplicate-vertex-expected.png differ diff --git a/tests/regression/opencsgtest/arc-expected.png b/tests/regression/opencsgtest/arc-expected.png new file mode 100644 index 0000000..a930c0e Binary files /dev/null and b/tests/regression/opencsgtest/arc-expected.png differ diff --git a/tests/regression/opencsgtest/circle-advanced-expected.png b/tests/regression/opencsgtest/circle-advanced-expected.png new file mode 100644 index 0000000..9dfbd61 Binary files /dev/null and b/tests/regression/opencsgtest/circle-advanced-expected.png differ diff --git a/tests/regression/opencsgtest/circle-double-expected.png b/tests/regression/opencsgtest/circle-double-expected.png new file mode 100644 index 0000000..81caba5 Binary files /dev/null and b/tests/regression/opencsgtest/circle-double-expected.png differ diff --git a/tests/regression/opencsgtest/circle-expected.png b/tests/regression/opencsgtest/circle-expected.png new file mode 100644 index 0000000..7bc63b1 Binary files /dev/null and b/tests/regression/opencsgtest/circle-expected.png differ diff --git a/tests/regression/opencsgtest/circle-small-expected.png b/tests/regression/opencsgtest/circle-small-expected.png new file mode 100644 index 0000000..9813b20 Binary files /dev/null and b/tests/regression/opencsgtest/circle-small-expected.png differ diff --git a/tests/regression/opencsgtest/ellipse-arc-expected.png b/tests/regression/opencsgtest/ellipse-arc-expected.png new file mode 100644 index 0000000..551630d Binary files /dev/null and b/tests/regression/opencsgtest/ellipse-arc-expected.png differ diff --git a/tests/regression/opencsgtest/ellipse-arc-rot-expected.png b/tests/regression/opencsgtest/ellipse-arc-rot-expected.png new file mode 100644 index 0000000..6b2a8e6 Binary files /dev/null and b/tests/regression/opencsgtest/ellipse-arc-rot-expected.png differ diff --git a/tests/regression/opencsgtest/ellipse-expected.png b/tests/regression/opencsgtest/ellipse-expected.png new file mode 100644 index 0000000..70ccad2 Binary files /dev/null and b/tests/regression/opencsgtest/ellipse-expected.png differ diff --git a/tests/regression/opencsgtest/ellipse-reverse-expected.png b/tests/regression/opencsgtest/ellipse-reverse-expected.png new file mode 100644 index 0000000..56c4710 Binary files /dev/null and b/tests/regression/opencsgtest/ellipse-reverse-expected.png differ diff --git a/tests/regression/opencsgtest/ellipse-rot-expected.png b/tests/regression/opencsgtest/ellipse-rot-expected.png new file mode 100644 index 0000000..598caa1 Binary files /dev/null and b/tests/regression/opencsgtest/ellipse-rot-expected.png differ diff --git a/tests/regression/opencsgtest/lwpolyline-closed-expected.png b/tests/regression/opencsgtest/lwpolyline-closed-expected.png new file mode 100644 index 0000000..c29d554 Binary files /dev/null and b/tests/regression/opencsgtest/lwpolyline-closed-expected.png differ diff --git a/tests/regression/opencsgtest/lwpolyline-expected.png b/tests/regression/opencsgtest/lwpolyline-expected.png new file mode 100644 index 0000000..c29d554 Binary files /dev/null and b/tests/regression/opencsgtest/lwpolyline-expected.png differ diff --git a/tests/regression/opencsgtest/lwpolyline2-expected.png b/tests/regression/opencsgtest/lwpolyline2-expected.png new file mode 100644 index 0000000..bdcb048 Binary files /dev/null and b/tests/regression/opencsgtest/lwpolyline2-expected.png differ diff --git a/tests/regression/opencsgtest/multiple-layers-expected.png b/tests/regression/opencsgtest/multiple-layers-expected.png new file mode 100644 index 0000000..1ba71bf Binary files /dev/null and b/tests/regression/opencsgtest/multiple-layers-expected.png differ diff --git a/tests/regression/opencsgtest/polygon-concave-expected.png b/tests/regression/opencsgtest/polygon-concave-expected.png new file mode 100644 index 0000000..130a5e6 Binary files /dev/null and b/tests/regression/opencsgtest/polygon-concave-expected.png differ diff --git a/tests/regression/opencsgtest/polygon-concave-hole-expected.png b/tests/regression/opencsgtest/polygon-concave-hole-expected.png new file mode 100644 index 0000000..22f035c Binary files /dev/null and b/tests/regression/opencsgtest/polygon-concave-hole-expected.png differ diff --git a/tests/regression/opencsgtest/polygon-concave-simple-expected.png b/tests/regression/opencsgtest/polygon-concave-simple-expected.png new file mode 100644 index 0000000..cf0569c Binary files /dev/null and b/tests/regression/opencsgtest/polygon-concave-simple-expected.png differ diff --git a/tests/regression/opencsgtest/polygon-holes-touch-expected.png b/tests/regression/opencsgtest/polygon-holes-touch-expected.png new file mode 100644 index 0000000..f72a36d Binary files /dev/null and b/tests/regression/opencsgtest/polygon-holes-touch-expected.png differ diff --git a/tests/regression/opencsgtest/polygon-intersect-expected.png b/tests/regression/opencsgtest/polygon-intersect-expected.png new file mode 100644 index 0000000..6f4f437 Binary files /dev/null and b/tests/regression/opencsgtest/polygon-intersect-expected.png differ diff --git a/tests/regression/opencsgtest/polygon-many-holes-expected.png b/tests/regression/opencsgtest/polygon-many-holes-expected.png new file mode 100644 index 0000000..cdbeae4 Binary files /dev/null and b/tests/regression/opencsgtest/polygon-many-holes-expected.png differ diff --git a/tests/regression/opencsgtest/polygon-mesh-expected.png b/tests/regression/opencsgtest/polygon-mesh-expected.png new file mode 100644 index 0000000..6f4f437 Binary files /dev/null and b/tests/regression/opencsgtest/polygon-mesh-expected.png differ diff --git a/tests/regression/opencsgtest/polygon-overlap-expected.png b/tests/regression/opencsgtest/polygon-overlap-expected.png new file mode 100644 index 0000000..6f4f437 Binary files /dev/null and b/tests/regression/opencsgtest/polygon-overlap-expected.png differ diff --git a/tests/regression/opencsgtest/polygon-riser-expected.png b/tests/regression/opencsgtest/polygon-riser-expected.png new file mode 100644 index 0000000..3513481 Binary files /dev/null and b/tests/regression/opencsgtest/polygon-riser-expected.png differ diff --git a/tests/regression/opencsgtest/polygon-self-intersect-expected.png b/tests/regression/opencsgtest/polygon-self-intersect-expected.png new file mode 100644 index 0000000..6f4f437 Binary files /dev/null and b/tests/regression/opencsgtest/polygon-self-intersect-expected.png differ diff --git a/tests/regression/opencsgtest/polygon8-expected.png b/tests/regression/opencsgtest/polygon8-expected.png new file mode 100644 index 0000000..5ee7c85 Binary files /dev/null and b/tests/regression/opencsgtest/polygon8-expected.png differ diff --git a/tests/regression/opencsgtest/polygons-expected.png b/tests/regression/opencsgtest/polygons-expected.png new file mode 100644 index 0000000..3ad971f Binary files /dev/null and b/tests/regression/opencsgtest/polygons-expected.png differ diff --git a/tests/regression/opencsgtest/transform-insert-expected.png b/tests/regression/opencsgtest/transform-insert-expected.png new file mode 100644 index 0000000..1d88a08 Binary files /dev/null and b/tests/regression/opencsgtest/transform-insert-expected.png differ diff --git a/tests/regression/opencsgtest/triangle-with-duplicate-vertex-expected.png b/tests/regression/opencsgtest/triangle-with-duplicate-vertex-expected.png new file mode 100644 index 0000000..393de76 Binary files /dev/null and b/tests/regression/opencsgtest/triangle-with-duplicate-vertex-expected.png differ -- cgit v0.10.1 From 0c2053caf9c7e521c31bbf603e8a1980d2eee3b2 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Sat, 1 Oct 2011 00:43:51 +0200 Subject: Removed unused includes diff --git a/src/transform.cc b/src/transform.cc index f473f6a..88f473f 100644 --- a/src/transform.cc +++ b/src/transform.cc @@ -27,13 +27,8 @@ #include "transformnode.h" #include "module.h" #include "context.h" -#include "dxfdata.h" -#include "csgterm.h" #include "polyset.h" -#include "dxftess.h" #include "builtin.h" -#include "printutils.h" -#include "visitor.h" #include #include #include -- cgit v0.10.1 From 84e98b178ad60b22ae6a3b60ea3f6296b1f71989 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Sat, 1 Oct 2011 01:36:30 +0200 Subject: Cleaned up some unnecessary includes diff --git a/openscad.pro b/openscad.pro index 765ff6b..271c34d 100644 --- a/openscad.pro +++ b/openscad.pro @@ -166,6 +166,8 @@ HEADERS += src/renderer.h \ src/Tree.h \ src/mathc99.h \ src/memory.h \ + src/linalg.h \ + src/system-gl.h \ src/stl-utils.h SOURCES += src/openscad.cc \ diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc index d950cb8..72d1f17 100644 --- a/src/CGALEvaluator.cc +++ b/src/CGALEvaluator.cc @@ -11,6 +11,7 @@ #include "polyset.h" #include "dxfdata.h" #include "dxftess.h" +#include "Tree.h" #include "CGALCache.h" #include "cgal.h" diff --git a/src/CGALEvaluator.h b/src/CGALEvaluator.h index c1b5ae8..0ac716c 100644 --- a/src/CGALEvaluator.h +++ b/src/CGALEvaluator.h @@ -3,7 +3,6 @@ #include "myqhash.h" #include "visitor.h" -#include "Tree.h" #include "CGAL_Nef_polyhedron.h" #include "PolySetCGALEvaluator.h" @@ -11,16 +10,11 @@ #include #include -using std::string; -using std::map; -using std::list; -using std::pair; - class CGALEvaluator : public Visitor { public: enum CsgOp {CGE_UNION, CGE_INTERSECTION, CGE_DIFFERENCE, CGE_MINKOWSKI}; - CGALEvaluator(const Tree &tree) : tree(tree), psevaluator(*this) {} + CGALEvaluator(const class Tree &tree) : tree(tree), psevaluator(*this) {} virtual ~CGALEvaluator() {} virtual Response visit(State &state, const AbstractNode &node); @@ -42,9 +36,9 @@ private: CGAL_Nef_polyhedron applyToChildren(const AbstractNode &node, CGALEvaluator::CsgOp op); CGAL_Nef_polyhedron applyHull(const CgaladvNode &node); - string currindent; - typedef list > ChildList; - map visitedchildren; + std::string currindent; + typedef std::list > ChildList; + std::map visitedchildren; const Tree &tree; public: diff --git a/src/CGALRenderer.h b/src/CGALRenderer.h index 5f854ea..9c19e5a 100644 --- a/src/CGALRenderer.h +++ b/src/CGALRenderer.h @@ -2,12 +2,11 @@ #define CGALRENDERER_H_ #include "renderer.h" -#include "CGAL_Nef_polyhedron.h" class CGALRenderer : public Renderer { public: - CGALRenderer(const CGAL_Nef_polyhedron &root); + CGALRenderer(const class CGAL_Nef_polyhedron &root); ~CGALRenderer(); void draw(bool showfaces, bool showedges) const; diff --git a/src/CSGTermEvaluator.cc b/src/CSGTermEvaluator.cc index ebea89c..2467c05 100644 --- a/src/CSGTermEvaluator.cc +++ b/src/CSGTermEvaluator.cc @@ -86,8 +86,8 @@ Response CSGTermEvaluator::visit(State &state, const AbstractIntersectionNode &n } static CSGTerm *evaluate_csg_term_from_ps(const State &state, - vector &highlights, - vector &background, + std::vector &highlights, + std::vector &background, const shared_ptr &ps, const ModuleInstantiation *modinst, const AbstractNode &node) diff --git a/src/CSGTermEvaluator.h b/src/CSGTermEvaluator.h index ac22906..cca6c91 100644 --- a/src/CSGTermEvaluator.h +++ b/src/CSGTermEvaluator.h @@ -1,39 +1,31 @@ #ifndef CSGTERMEVALUATOR_H_ #define CSGTERMEVALUATOR_H_ -#include #include #include #include -#include "Tree.h" #include "visitor.h" -#include "node.h" - -using std::string; -using std::map; -using std::list; -using std::vector; class CSGTermEvaluator : public Visitor { public: - CSGTermEvaluator(const Tree &tree, class PolySetEvaluator *psevaluator = NULL) + CSGTermEvaluator(const class Tree &tree, class PolySetEvaluator *psevaluator = NULL) : tree(tree), psevaluator(psevaluator) { } virtual ~CSGTermEvaluator() {} - virtual Response visit(State &state, const AbstractNode &node); - virtual Response visit(State &state, const AbstractIntersectionNode &node); - virtual Response visit(State &state, const AbstractPolyNode &node); - virtual Response visit(State &state, const CsgNode &node); - virtual Response visit(State &state, const TransformNode &node); - virtual Response visit(State &state, const ColorNode &node); - virtual Response visit(State &state, const RenderNode &node); - virtual Response visit(State &state, const CgaladvNode &node); + virtual Response visit(State &state, const class AbstractNode &node); + virtual Response visit(State &state, const class AbstractIntersectionNode &node); + virtual Response visit(State &state, const class AbstractPolyNode &node); + virtual Response visit(State &state, const class CsgNode &node); + virtual Response visit(State &state, const class TransformNode &node); + virtual Response visit(State &state, const class ColorNode &node); + virtual Response visit(State &state, const class RenderNode &node); + virtual Response visit(State &state, const class CgaladvNode &node); class CSGTerm *evaluateCSGTerm(const AbstractNode &node, - vector &highlights, - vector &background); + std::vector &highlights, + std::vector &background); private: enum CsgOp {CSGT_UNION, CSGT_INTERSECTION, CSGT_DIFFERENCE, CSGT_MINKOWSKI}; @@ -41,14 +33,14 @@ private: void applyToChildren(const AbstractNode &node, CSGTermEvaluator::CsgOp op); const AbstractNode *root; - typedef list ChildList; - map visitedchildren; + typedef std::list ChildList; + std::map visitedchildren; public: - map stored_term; // The term evaluated from each node index + std::map stored_term; // The term evaluated from each node index - vector highlights; - vector background; + std::vector highlights; + std::vector background; const Tree &tree; class PolySetEvaluator *psevaluator; }; diff --git a/src/GLView.h b/src/GLView.h index 1001754..3a36a15 100644 --- a/src/GLView.h +++ b/src/GLView.h @@ -1,11 +1,7 @@ #ifndef GLVIEW_H_ #define GLVIEW_H_ -#ifdef ENABLE_OPENCSG -// this must be included before the GL headers -# include -#endif - +#include "system-gl.h" #include #include diff --git a/src/MainWindow.h b/src/MainWindow.h index 0ba3bd9..37a6a4c 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -6,9 +6,7 @@ #include "openscad.h" #include "context.h" #include "module.h" -#include "polyset.h" #include "Tree.h" -#include #include class MainWindow : public QMainWindow, public Ui::MainWindow diff --git a/src/OpenCSGRenderer.cc b/src/OpenCSGRenderer.cc index 4a86c5c..a030e6c 100644 --- a/src/OpenCSGRenderer.cc +++ b/src/OpenCSGRenderer.cc @@ -24,7 +24,7 @@ * */ -#include +#include "system-gl.h" #include "OpenCSGRenderer.h" #include "polyset.h" #include "csgterm.h" diff --git a/src/OpenCSGRenderer.h b/src/OpenCSGRenderer.h index 95ffc8e..e6091aa 100644 --- a/src/OpenCSGRenderer.h +++ b/src/OpenCSGRenderer.h @@ -2,8 +2,7 @@ #define OPENCSGRENDERER_H_ #include "renderer.h" -#include // this must be included before the GL headers -#include +#include "system-gl.h" class OpenCSGRenderer : public Renderer { diff --git a/src/PolySetEvaluator.cc b/src/PolySetEvaluator.cc index 1f09127..b5075ba 100644 --- a/src/PolySetEvaluator.cc +++ b/src/PolySetEvaluator.cc @@ -2,6 +2,7 @@ #include "PolySetEvaluator.h" #include "printutils.h" #include "polyset.h" +#include "Tree.h" /*! The task of PolySetEvaluator is to create, keep track of and cache PolySet instances. diff --git a/src/PolySetEvaluator.h b/src/PolySetEvaluator.h index 8d7d1a8..348cbba 100644 --- a/src/PolySetEvaluator.h +++ b/src/PolySetEvaluator.h @@ -1,19 +1,17 @@ #ifndef POLYSETEVALUATOR_H_ #define POLYSETEVALUATOR_H_ -#include "node.h" -#include "Tree.h" #include "memory.h" class PolySetEvaluator { public: - PolySetEvaluator(const Tree &tree) : tree(tree) {} + PolySetEvaluator(const class Tree &tree) : tree(tree) {} virtual ~PolySetEvaluator() {} const Tree &getTree() const { return this->tree; } - virtual shared_ptr getPolySet(const class AbstractNode &, bool cache); + virtual shared_ptr getPolySet(const class AbstractNode &, bool cache); virtual PolySet *evaluatePolySet(const class ProjectionNode &) { return NULL; } virtual PolySet *evaluatePolySet(const class LinearExtrudeNode &) { return NULL; } diff --git a/src/ThrownTogetherRenderer.cc b/src/ThrownTogetherRenderer.cc index 956fc11..7a92e7f 100644 --- a/src/ThrownTogetherRenderer.cc +++ b/src/ThrownTogetherRenderer.cc @@ -28,8 +28,7 @@ #include "polyset.h" #include "csgterm.h" -#include // this must be included before the GL headers -#include +#include "system-gl.h" ThrownTogetherRenderer::ThrownTogetherRenderer(CSGChain *root_chain, CSGChain *highlights_chain, diff --git a/src/cgaladv.cc b/src/cgaladv.cc index 5014133..c83e18b 100644 --- a/src/cgaladv.cc +++ b/src/cgaladv.cc @@ -28,7 +28,6 @@ #include "module.h" #include "context.h" #include "builtin.h" -#include "printutils.h" #include "PolySetEvaluator.h" #include #include diff --git a/src/cgaladv_minkowski2.cc b/src/cgaladv_minkowski2.cc index f08e7d6..4ce684f 100644 --- a/src/cgaladv_minkowski2.cc +++ b/src/cgaladv_minkowski2.cc @@ -26,7 +26,6 @@ #ifdef ENABLE_CGAL -#include "node.h" #include "printutils.h" #include "grid.h" #include "cgal.h" diff --git a/src/color.cc b/src/color.cc index a65a8e4..ee8f872 100644 --- a/src/color.cc +++ b/src/color.cc @@ -29,7 +29,6 @@ #include "context.h" #include "builtin.h" #include "printutils.h" -#include "visitor.h" #include #include #include diff --git a/src/csgops.cc b/src/csgops.cc index 98d68c7..7b363f0 100644 --- a/src/csgops.cc +++ b/src/csgops.cc @@ -29,7 +29,6 @@ #include "module.h" #include "csgterm.h" #include "builtin.h" -#include "printutils.h" #include #include diff --git a/src/csgterm.h b/src/csgterm.h index c12b7ae..63d1240 100644 --- a/src/csgterm.h +++ b/src/csgterm.h @@ -3,8 +3,10 @@ #include #include -#include "polyset.h" #include "memory.h" +#include "linalg.h" + +class PolySet; class CSGTerm { diff --git a/src/dxftess-glu.cc b/src/dxftess-glu.cc index 23d8a45..4ad2051 100644 --- a/src/dxftess-glu.cc +++ b/src/dxftess-glu.cc @@ -4,13 +4,11 @@ #include "grid.h" #include -#ifdef ENABLE_OPENCSG -// this must be included before the GL headers -# include -#endif -#include +#include "system-gl.h" #include "mathc99.h" +#include + #ifdef WIN32 # define STDCALL __stdcall #else diff --git a/src/export.h b/src/export.h index cba0b23..dd6e3e0 100644 --- a/src/export.h +++ b/src/export.h @@ -5,8 +5,7 @@ #include -void cgal_nef3_to_polyset(class PolySet *ps, class CGAL_Nef_polyhedron *root_N); -void export_stl(CGAL_Nef_polyhedron *root_N, std::ostream &output, class QProgressDialog *pd); +void export_stl(class CGAL_Nef_polyhedron *root_N, std::ostream &output, class QProgressDialog *pd); void export_off(CGAL_Nef_polyhedron *root_N, std::ostream &output, QProgressDialog *pd); void export_dxf(CGAL_Nef_polyhedron *root_N, std::ostream &output, QProgressDialog *pd); #endif diff --git a/src/func.cc b/src/func.cc index b58a1b7..964214f 100644 --- a/src/func.cc +++ b/src/func.cc @@ -27,7 +27,6 @@ #include "function.h" #include "expression.h" #include "context.h" -#include "dxfdim.h" #include "builtin.h" #include #include diff --git a/src/linalg.h b/src/linalg.h new file mode 100644 index 0000000..60a706f --- /dev/null +++ b/src/linalg.h @@ -0,0 +1,10 @@ +#ifndef LINALG_H_ +#define LINALG_H_ + +#include +#include + +using Eigen::Vector3d; +typedef Eigen::AlignedBox BoundingBox; + +#endif diff --git a/src/linearextrude.cc b/src/linearextrude.cc index 4ce87db..5c3b684 100644 --- a/src/linearextrude.cc +++ b/src/linearextrude.cc @@ -30,11 +30,6 @@ #include "context.h" #include "printutils.h" #include "builtin.h" -#include "dxfdata.h" -#include "dxftess.h" -#include "polyset.h" -#include "progress.h" -#include "visitor.h" #include "PolySetEvaluator.h" #include "openscad.h" // get_fragments_from_r() @@ -124,7 +119,7 @@ void register_builtin_dxf_linear_extrude() builtin_modules["linear_extrude"] = new LinearExtrudeModule(); } -PolySet *LinearExtrudeNode::evaluate_polyset(PolySetEvaluator *evaluator) const +class PolySet *LinearExtrudeNode::evaluate_polyset(PolySetEvaluator *evaluator) const { if (!evaluator) { PRINTF("WARNING: No suitable PolySetEvaluator found for %s module!", this->name().c_str()); diff --git a/src/mainwin.cc b/src/mainwin.cc index 51e85e7..cce2971 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -33,13 +33,10 @@ #include "polyset.h" #include "csgterm.h" #include "highlighter.h" -#include "grid.h" -#include "dxfdata.h" -#include "dxfdim.h" #include "export.h" #include "builtin.h" -#include "dxftess.h" #include "progress.h" +#include "dxfdim.h" #ifdef ENABLE_OPENCSG #include "CSGTermEvaluator.h" #include "OpenCSGRenderer.h" diff --git a/src/node.cc b/src/node.cc index e2f3fa0..12a7ca4 100644 --- a/src/node.cc +++ b/src/node.cc @@ -24,17 +24,13 @@ * */ -#include "printutils.h" #include "node.h" #include "module.h" -#include "csgterm.h" #include "progress.h" -#include "polyset.h" #include "visitor.h" -#include "nodedumper.h" #include "stl-utils.h" -#include +#include #include size_t AbstractNode::idx_counter; diff --git a/src/node.h b/src/node.h index 9f25627..de5e6aa 100644 --- a/src/node.h +++ b/src/node.h @@ -3,7 +3,6 @@ #include #include - #include "traverser.h" extern int progress_report_count; diff --git a/src/nodedumper.cc b/src/nodedumper.cc index d75c703..4523bac 100644 --- a/src/nodedumper.cc +++ b/src/nodedumper.cc @@ -1,13 +1,8 @@ #include "nodedumper.h" -#include -#include -#include -#include "visitor.h" #include "state.h" -#include "nodecache.h" +#include #include -#include #include /*! @@ -42,7 +37,7 @@ void NodeDumper::handleIndent(const State &state) including braces and indentation. All children are assumed to be cached already. */ -string NodeDumper::dumpChildren(const AbstractNode &node) +std::string NodeDumper::dumpChildren(const AbstractNode &node) { std::stringstream dump; if (!this->visitedchildren[node.index()].empty()) { diff --git a/src/openscad.h b/src/openscad.h index 9d97bac..e6b9b9f 100644 --- a/src/openscad.h +++ b/src/openscad.h @@ -27,11 +27,6 @@ #ifndef OPENSCAD_H #define OPENSCAD_H -#ifdef ENABLE_OPENCSG -// this must be included before the GL headers -# include -#endif - // for win32 and maybe others.. #ifndef M_PI # define M_PI 3.14159265358979323846 diff --git a/src/polyset.cc b/src/polyset.cc index 23b9876..ec0cdf9 100644 --- a/src/polyset.cc +++ b/src/polyset.cc @@ -25,7 +25,6 @@ */ #include "polyset.h" -#include "printutils.h" // FIXME: Reenable/rewrite - don't be dependant on GUI // #include "Preferences.h" #ifdef ENABLE_CGAL diff --git a/src/polyset.h b/src/polyset.h index c59d86a..2fe1c1f 100644 --- a/src/polyset.h +++ b/src/polyset.h @@ -1,14 +1,10 @@ #ifndef POLYSET_H_ #define POLYSET_H_ -#include +#include "system-gl.h" #include "grid.h" +#include "linalg.h" #include -#include -#include - -using Eigen::Vector3d; -typedef Eigen::AlignedBox BoundingBox; class PolySet { diff --git a/src/primitives.cc b/src/primitives.cc index 08b9c62..a651ff8 100644 --- a/src/primitives.cc +++ b/src/primitives.cc @@ -32,7 +32,6 @@ #include "dxftess.h" #include "builtin.h" #include "printutils.h" -#include #include "visitor.h" #include #include diff --git a/src/printutils.cc b/src/printutils.cc index 01fa06b..a315ab3 100644 --- a/src/printutils.cc +++ b/src/printutils.cc @@ -1,5 +1,6 @@ #include "printutils.h" #include +#include QList print_messages_stack; OutputHandlerFunc *outputhandler = NULL; diff --git a/src/printutils.h b/src/printutils.h index 0432622..60cd12a 100644 --- a/src/printutils.h +++ b/src/printutils.h @@ -5,7 +5,6 @@ #include #include #include -#include typedef void (OutputHandlerFunc)(const QString &msg, void *userdata); extern OutputHandlerFunc *outputhandler; diff --git a/src/projection.cc b/src/projection.cc index 2c9d821..1333d19 100644 --- a/src/projection.cc +++ b/src/projection.cc @@ -29,19 +29,9 @@ #include "context.h" #include "printutils.h" #include "builtin.h" -#include "dxfdata.h" -#include "dxftess.h" -#include "polyset.h" -#include "export.h" -#include "progress.h" #include "visitor.h" #include "PolySetEvaluator.h" -#ifdef ENABLE_CGAL -# include -# include -#endif - #include #include #include diff --git a/src/render.cc b/src/render.cc index f08423a..b79fa56 100644 --- a/src/render.cc +++ b/src/render.cc @@ -28,9 +28,6 @@ #include "module.h" #include "context.h" #include "builtin.h" -#include "printutils.h" -#include "progress.h" -#include "visitor.h" #include "PolySetEvaluator.h" #include diff --git a/src/rotateextrude.cc b/src/rotateextrude.cc index 3a6eb55..4d6de73 100644 --- a/src/rotateextrude.cc +++ b/src/rotateextrude.cc @@ -30,8 +30,6 @@ #include "printutils.h" #include "builtin.h" #include "polyset.h" -#include "dxfdata.h" -#include "progress.h" #include "visitor.h" #include "PolySetEvaluator.h" #include "openscad.h" // get_fragments_from_r() diff --git a/src/surface.cc b/src/surface.cc index 35449ed..8349afd 100644 --- a/src/surface.cc +++ b/src/surface.cc @@ -29,7 +29,6 @@ #include "polyset.h" #include "context.h" #include "builtin.h" -#include "dxftess.h" #include "printutils.h" #include "handle_dep.h" // handle_dep() #include "visitor.h" diff --git a/src/system-gl.h b/src/system-gl.h new file mode 100644 index 0000000..cdbf3dc --- /dev/null +++ b/src/system-gl.h @@ -0,0 +1,11 @@ +#ifndef SYSTEMGL_H_ +#define SYSTEMGL_H_ + +#include +#ifdef __APPLE__ +#include +#else +#include +#endif + +#endif diff --git a/tests/csgtermtest.cc b/tests/csgtermtest.cc index 7c37b0a..8579182 100644 --- a/tests/csgtermtest.cc +++ b/tests/csgtermtest.cc @@ -26,7 +26,6 @@ #include "myqhash.h" #include "PolySetEvaluator.h" #include "CSGTermEvaluator.h" -#include "CSGTextCache.h" #include "openscad.h" #include "handle_dep.h" #include "node.h" @@ -144,8 +143,8 @@ int main(int argc, char **argv) // cout << tree.getString(*root_node) << "\n"; - vector highlights; - vector background; + std::vector highlights; + std::vector background; PolySetEvaluator psevaluator(tree); CSGTermEvaluator evaluator(tree, &psevaluator); CSGTerm *root_term = evaluator.evaluateCSGTerm(*root_node, highlights, background); -- cgit v0.10.1 From 4432eb78aa5fc46a746893f8bdfe4f62f83e61a4 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Mon, 3 Oct 2011 01:38:12 +0200 Subject: Updated version requirements of 3rd party libraries diff --git a/README b/README index 0351ff6..85baf16 100644 --- a/README +++ b/README @@ -37,7 +37,7 @@ development. Other versions may or may not work as well.. * Qt4 (4.4 - 4.7): http://www.qtsoftware.com/ -* CGAL (3.6 - 3.7): +* CGAL (3.6 - 3.9): http://www.cgal.org/ * GMP (5.0.x): @@ -46,7 +46,7 @@ development. Other versions may or may not work as well.. * MPFR (3.0.x): http://www.mpfr.org/ -* boost (1.35 - 1.44, required by CGAL) +* boost (1.35 - 1.47) http://www.boost.org/ * cmake (2.6.x, required by CGAL) @@ -55,10 +55,10 @@ development. Other versions may or may not work as well.. * OpenCSG (1.3.0): http://www.opencsg.org/ -* GLEW (1.5.x, also bundled with OpenCSG) +* GLEW (1.5.x, 1.6.x, also bundled with OpenCSG) http://glew.sourceforge.net/ -* Eigen2 (2.0.11) +* Eigen2 (2.0.13->) http://eigen.tuxfamily.org/ * GCC C++ Compiler (4.2, 4.3.1): -- cgit v0.10.1 From 2f239205a8f46cf00dfd461a72909867fa4aca80 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Tue, 4 Oct 2011 00:09:04 +0200 Subject: Redefined version() to return the version as a vector. Added version_num() to return a comparable number diff --git a/RELEASE_NOTES b/RELEASE_NOTES index f8a10f0..9097721 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -10,7 +10,8 @@ o The color() statement now supports an alpha parameter, e.g. color(c=[1,0,0], a o The color() statement now supports specifying colors as strings, e.g. color("Red") o if() and else() can now take any value type as parameter. false, 0, empty string and empty vector or illegal value type will evaluate as false, everything else as true. o Strings can now be lexographically compared using the <, <=, >, >= operators -o The version() function will return the OpenSCAD version as a string, e.g. "2011.10" +o The version() function will return the OpenSCAD version as a vector, e.g. [2011, 09] +o The version_num() function will return the OpenSCAD version as a number, e.g. 20110923 Bugfixes: o square() crashed if any of the dimensions were zero diff --git a/openscad.pro b/openscad.pro index 271c34d..3a41800 100644 --- a/openscad.pro +++ b/openscad.pro @@ -13,6 +13,10 @@ win32 { } else { isEmpty(VERSION) VERSION = $$system(date "+%Y.%m.%d") } +VERSION_SPLIT=$$split(VERSION, ".") +VERSION_YEAR=$$member(VERSION_SPLIT, 0) +VERSION_MONTH=$$member(VERSION_SPLIT, 1) +VERSION_DAY=$$member(VERSION_SPLIT, 2) #configure lex / yacc win32 { @@ -31,7 +35,8 @@ win32 { INCLUDEPATH += $$(MPFRDIR) } -DEFINES += OPENSCAD_VERSION=$$VERSION +DEFINES += OPENSCAD_VERSION=$$VERSION OPENSCAD_YEAR=$$VERSION_YEAR OPENSCAD_MONTH=$$VERSION_MONTH +!isEmpty(VERSION_DAY): DEFINES += OPENSCAD_DAY=$$VERSION_DAY win32:DEFINES += _USE_MATH_DEFINES NOMINMAX _CRT_SECURE_NO_WARNINGS YY_NO_UNISTD_H #disable warning about too long decorated names diff --git a/src/func.cc b/src/func.cc index 964214f..b011a27 100644 --- a/src/func.cc +++ b/src/func.cc @@ -353,7 +353,26 @@ Value builtin_lookup(const Context *, const std::vector&, const std Value builtin_version(const Context *, const std::vector&, const std::vector &) { - return Value(std::string(QUOTED(OPENSCAD_VERSION))); + Value val; + val.type = Value::VECTOR; + val.append(new Value(double(OPENSCAD_YEAR))); + val.append(new Value(double(OPENSCAD_MONTH))); +#ifdef OPENSCAD_DAY + val.append(new Value(double(OPENSCAD_DAY))); +#endif + return val; +} + +Value builtin_version_num(const Context *ctx, const std::vector& call_argnames, const std::vector &args) +{ + Value val = (args.size() == 0) ? builtin_version(ctx, call_argnames, args) : args[0]; + double y, m, d = 0; + if (!val.getv3(y, m, d)) { + if (!val.getv2(y, m)) { + return Value(); + } + } + return Value(y * 10000 + m * 100 + d); } void initialize_builtin_functions() @@ -381,6 +400,7 @@ void initialize_builtin_functions() builtin_functions["str"] = new BuiltinFunction(&builtin_str); builtin_functions["lookup"] = new BuiltinFunction(&builtin_lookup); builtin_functions["version"] = new BuiltinFunction(&builtin_version); + builtin_functions["version_num"] = new BuiltinFunction(&builtin_version_num); initialize_builtin_dxf_dim(); } diff --git a/testdata/scad/minimal/allfunctions.scad b/testdata/scad/minimal/allfunctions.scad index c33b43c..ef21a90 100644 --- a/testdata/scad/minimal/allfunctions.scad +++ b/testdata/scad/minimal/allfunctions.scad @@ -23,3 +23,4 @@ a = lookup(); a = dxf_dim(); a = dxf_cross(); a = version(); +a = version_num(); -- cgit v0.10.1 From 71310298e54a59c0364f6d7aeafcd5b1f14e3615 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Tue, 4 Oct 2011 00:21:26 +0200 Subject: sync diff --git a/doc/TODO.txt b/doc/TODO.txt index 97af30a..65534b8 100644 --- a/doc/TODO.txt +++ b/doc/TODO.txt @@ -114,6 +114,8 @@ o Misc - Save: Ask for confirmation if file has been externally changed - Rename OpenCSG and CGAL to smth. not specific to the underlying libraries (e.g Preview, Render) + - If trying to export STL/DXF but source is newer than the CGAL rendering, ask + for confirmation. o Cmd-line - Add verbose option (PRINT command from mainwin.cc and progress output) -- cgit v0.10.1 From 7c9f2fa616f320ccc3800247894326ef2ac6dabc Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Tue, 4 Oct 2011 00:34:49 +0200 Subject: Don't try to autoreload empty file. Version string cosmetics diff --git a/src/mainwin.cc b/src/mainwin.cc index cce2971..238bd10 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -99,8 +99,7 @@ unsigned int GuiLocker::gui_locked = 0; #define QUOTED(x__) QUOTE(x__) static char helptitle[] = - "OpenSCAD " QUOTED(OPENSCAD_VERSION) " (www.openscad.org)\n" - "Visitor refactored version\n"; + "OpenSCAD " QUOTED(OPENSCAD_VERSION) " (www.openscad.org)\n\n"; static char copyrighttext[] = "Copyright (C) 2009-2011 Marius Kintel and Clifford Wolf \n" "\n" @@ -1071,12 +1070,14 @@ void MainWindow::pasteViewportRotation() void MainWindow::checkAutoReload() { - QString new_stinfo; - QFileInfo finfo(this->fileName); - new_stinfo = QString::number(finfo.size()) + QString::number(finfo.lastModified().toTime_t()); - if (new_stinfo != autoReloadInfo) - actionReloadCompile(); - autoReloadInfo = new_stinfo; + if (!this->fileName.isEmpty()) { + QString new_stinfo; + QFileInfo finfo(this->fileName); + new_stinfo = QString::number(finfo.size()) + QString::number(finfo.lastModified().toTime_t()); + if (new_stinfo != autoReloadInfo) + actionReloadCompile(); + autoReloadInfo = new_stinfo; + } } void MainWindow::autoReloadSet(bool on) -- cgit v0.10.1 From 3e05291f09361f4a8cdd20bc025ad89e70cba0d6 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Tue, 4 Oct 2011 00:41:41 +0200 Subject: Disable insertion of rich text as it caused copy and paste errors. Reported and fixed by 'Moc' diff --git a/src/editor.h b/src/editor.h index c2f3333..3088d20 100644 --- a/src/editor.h +++ b/src/editor.h @@ -22,7 +22,7 @@ public slots: //void zoomOut() { zoom(-1); } void zoomOut(int n = 1) { zoom(-n); } #else - Editor(QWidget *parent) : QTextEdit(parent) {} + Editor(QWidget *parent) : QTextEdit(parent) { setAcceptRichText(false); } public slots: void setLineWrapping(bool on) { if(on) setWordWrapMode(QTextOption::WrapAnywhere); } void setContentModified(bool y) { document()->setModified(y); } -- cgit v0.10.1 From 0066a00c083d2399c174e69465139d78e1bed8a3 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Tue, 4 Oct 2011 00:42:50 +0200 Subject: sync diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 9097721..a6a0855 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -18,7 +18,7 @@ o square() crashed if any of the dimensions were zero o Flush Caches didn't flush cached USE'd modules o STL export should be a bit more robust o Dropping a file into the editor under Windows didn't work (double C:/C:/ problem) - +o On some platforms it was possible to insertion rich text in the editor, causing confusion. Deprecations: o dxf_linear_extrude() and dxf_rotate_extrude() are now deprecated. -- cgit v0.10.1 From ea67faa9d60eb14c1c3d0d574aa933085de380c2 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Tue, 4 Oct 2011 03:03:25 +0200 Subject: FIXME: Add scale() tests diff --git a/testdata/scad/features/transform-tests.scad b/testdata/scad/features/transform-tests.scad index a591695..1d5d72b 100644 --- a/testdata/scad/features/transform-tests.scad +++ b/testdata/scad/features/transform-tests.scad @@ -15,4 +15,4 @@ multmatrix([[1,0.4,0.1,-25], [0.2,0.2,0.5,0], [0,0,0,1]]) mycyl(); -//FIXME: mirror() \ No newline at end of file +//FIXME: mirror() and scale() \ No newline at end of file -- cgit v0.10.1 From ad3accb52a7b420db50a2d75053b6660b02984bd Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Tue, 4 Oct 2011 03:04:00 +0200 Subject: Compile fix: Added OPENSCAD_YEAR and OPENSCAD_MONTH defines diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3a59c3e..00a9238 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -76,7 +76,7 @@ set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/parser_yacc.c PROPERTIES # Internal includes include_directories(../src) -add_definitions(-DOPENSCAD_VERSION=test) +add_definitions(-DOPENSCAD_VERSION=test -DOPENSCAD_YEAR=2011 -DOPENSCAD_MONTH=10) set(COMMON_SOURCES ../src/handle_dep.cc -- cgit v0.10.1 From afc0f1e9495b014022c4cf419c63b931a8e83bc2 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Tue, 4 Oct 2011 03:32:08 +0200 Subject: Added euler angle rotate test diff --git a/testdata/scad/features/transform-tests.scad b/testdata/scad/features/transform-tests.scad index 1d5d72b..e2dd71e 100644 --- a/testdata/scad/features/transform-tests.scad +++ b/testdata/scad/features/transform-tests.scad @@ -5,6 +5,7 @@ module mycyl() { translate([25,0,0]) scale([1,2,0.5]) mycyl(); translate([20,-30,0]) scale(0.5) mycyl(); translate([0,-20,0]) rotate([90,0,0]) mycyl(); +translate([0,-40,0]) rotate([90,0,45]) mycyl(); rotate(v=[-1,0,0], a=45) mycyl(); multmatrix([[1,0,0,-25], [0,1,0,0], diff --git a/tests/regression/opencsgtest/transform-tests-expected.png b/tests/regression/opencsgtest/transform-tests-expected.png index 9c763ba..dc43942 100644 Binary files a/tests/regression/opencsgtest/transform-tests-expected.png and b/tests/regression/opencsgtest/transform-tests-expected.png differ -- cgit v0.10.1 From 85948590ee0c6a353502c5493ecaf45730e08984 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Tue, 4 Oct 2011 03:40:54 +0200 Subject: Added euler angle rotate test diff --git a/tests/regression/cgalpngtest/transform-tests-expected.png b/tests/regression/cgalpngtest/transform-tests-expected.png index 08cfce8..77c52e7 100644 Binary files a/tests/regression/cgalpngtest/transform-tests-expected.png and b/tests/regression/cgalpngtest/transform-tests-expected.png differ -- cgit v0.10.1 From f5e0f3a531b0c8806e4ebc62cd91ca31275ae481 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Tue, 4 Oct 2011 03:41:43 +0200 Subject: Rewrote some hard to read linear algebra code to use Eigen diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc index 72d1f17..10160ae 100644 --- a/src/CGALEvaluator.cc +++ b/src/CGALEvaluator.cc @@ -206,8 +206,8 @@ Response CGALEvaluator::visit(State &state, const TransformNode &node) // tesselate it and create a new CGAL_Nef_polyhedron2 from it.. What a hack! CGAL_Aff_transformation2 t( - node.matrix[0], node.matrix[4], node.matrix[12], - node.matrix[1], node.matrix[5], node.matrix[13], node.matrix[15]); + node.matrix(0,0), node.matrix(0,1), node.matrix(0,3), + node.matrix(1,0), node.matrix(1,1), node.matrix(1,3), node.matrix(3,3)); DxfData *dd = N.convertToDxfData(); for (size_t i=0; i < dd->points.size(); i++) { @@ -226,9 +226,9 @@ Response CGALEvaluator::visit(State &state, const TransformNode &node) } else if (N.dim == 3) { CGAL_Aff_transformation t( - node.matrix[0], node.matrix[4], node.matrix[ 8], node.matrix[12], - node.matrix[1], node.matrix[5], node.matrix[ 9], node.matrix[13], - node.matrix[2], node.matrix[6], node.matrix[10], node.matrix[14], node.matrix[15]); + node.matrix(0,0), node.matrix(0,1), node.matrix(0,2), node.matrix(0,3), + node.matrix(1,0), node.matrix(1,1), node.matrix(1,2), node.matrix(1,3), + node.matrix(2,0), node.matrix(2,1), node.matrix(2,2), node.matrix(2,3), node.matrix(3,3)); N.p3->transform(t); } CGALCache::instance()->insert(this->tree.getIdString(node), N); diff --git a/src/CSGTermEvaluator.cc b/src/CSGTermEvaluator.cc index 2467c05..d1af987 100644 --- a/src/CSGTermEvaluator.cc +++ b/src/CSGTermEvaluator.cc @@ -147,18 +147,7 @@ Response CSGTermEvaluator::visit(State &state, const CsgNode &node) Response CSGTermEvaluator::visit(State &state, const TransformNode &node) { if (state.isPrefix()) { - double m[16]; - - for (int i = 0; i < 16; i++) - { - int c_row = i%4; - int m_col = i/4; - m[i] = 0; - for (int j = 0; j < 4; j++) { - m[i] += state.matrix()[c_row + j*4] * node.matrix[m_col*4 + j]; - } - } - state.setMatrix(m); + state.setMatrix(state.matrix() * node.matrix); } if (state.isPostfix()) { applyToChildren(node, CSGT_UNION); diff --git a/src/OpenCSGRenderer.cc b/src/OpenCSGRenderer.cc index a030e6c..5d6b0da 100644 --- a/src/OpenCSGRenderer.cc +++ b/src/OpenCSGRenderer.cc @@ -39,11 +39,11 @@ public: OpenCSGPrim(OpenCSG::Operation operation, unsigned int convexity) : OpenCSG::Primitive(operation, convexity) { } shared_ptr ps; - double *m; + Transform3d m; int csgmode; virtual void render() { glPushMatrix(); - glMultMatrixd(m); + glMultMatrixd(m.data()); ps->render_surface(PolySet::COLORMODE_NONE, PolySet::csgmode_e(csgmode), m); glPopMatrix(); } @@ -85,10 +85,10 @@ void OpenCSGRenderer::renderCSGChain(CSGChain *chain, GLint *shaderinfo, } if (shaderinfo) glUseProgram(shaderinfo[0]); for (; j < i; j++) { - double *m = chain->matrices[j]; + const Transform3d &m = chain->matrices[j]; double *c = chain->colors[j]; glPushMatrix(); - glMultMatrixd(m); + glMultMatrixd(m.data()); int csgmode = chain->types[j] == CSGTerm::TYPE_DIFFERENCE ? PolySet::CSGMODE_DIFFERENCE : PolySet::CSGMODE_NORMAL; if (highlight) { chain->polysets[j]->render_surface(PolySet::COLORMODE_HIGHLIGHT, PolySet::csgmode_e(csgmode + 20), m, shaderinfo); diff --git a/src/ThrownTogetherRenderer.cc b/src/ThrownTogetherRenderer.cc index 7a92e7f..01c7513 100644 --- a/src/ThrownTogetherRenderer.cc +++ b/src/ThrownTogetherRenderer.cc @@ -60,14 +60,14 @@ void ThrownTogetherRenderer::renderCSGChain(CSGChain *chain, bool highlight, bool fberror) const { glDepthFunc(GL_LEQUAL); - QHash,int> polySetVisitMark; + QHash,int> polySetVisitMark; for (size_t i = 0; i < chain->polysets.size(); i++) { - if (polySetVisitMark[QPair(chain->polysets[i].get(), chain->matrices[i])]++ > 0) + if (polySetVisitMark[QPair(chain->polysets[i].get(), &chain->matrices[i])]++ > 0) continue; - double *m = chain->matrices[i]; + const Transform3d &m = chain->matrices[i]; double *c = chain->colors[i]; glPushMatrix(); - glMultMatrixd(m); + glMultMatrixd(m.data()); int csgmode = chain->types[i] == CSGTerm::TYPE_DIFFERENCE ? PolySet::CSGMODE_DIFFERENCE : PolySet::CSGMODE_NORMAL; if (highlight) { chain->polysets[i]->render_surface(PolySet::COLORMODE_HIGHLIGHT, PolySet::csgmode_e(csgmode + 20), m); diff --git a/src/csgterm.cc b/src/csgterm.cc index 8306aaf..16ef75f 100644 --- a/src/csgterm.cc +++ b/src/csgterm.cc @@ -47,10 +47,10 @@ */ -CSGTerm::CSGTerm(const shared_ptr &polyset, const double matrix[16], const double color[4], const std::string &label) +CSGTerm::CSGTerm(const shared_ptr &polyset, const Transform3d &matrix, const double color[4], const std::string &label) : type(TYPE_PRIMITIVE), polyset(polyset), label(label), left(NULL), right(NULL) { - for (int i = 0; i < 16; i++) this->m[i] = matrix[i]; + this->m = matrix; for (int i = 0; i < 4; i++) this->color[i] = color[i]; refcounter = 1; } @@ -188,7 +188,7 @@ CSGChain::CSGChain() { } -void CSGChain::add(const shared_ptr &polyset, double *m, double *color, CSGTerm::type_e type, std::string label) +void CSGChain::add(const shared_ptr &polyset, const Transform3d &m, double *color, CSGTerm::type_e type, std::string label) { polysets.push_back(polyset); matrices.push_back(m); @@ -236,11 +236,7 @@ BoundingBox CSGChain::getBoundingBox() const if (!psbox.isNull()) { Eigen::Transform3d t; // Column-major vs. Row-major - t.matrix() << - matrices[i][0], matrices[i][4], matrices[i][8], matrices[i][12], - matrices[i][1], matrices[i][5], matrices[i][9], matrices[i][13], - matrices[i][2], matrices[i][6], matrices[i][10], matrices[i][14], - matrices[i][3], matrices[i][7], matrices[i][11], matrices[i][15]; + t = matrices[i]; bbox.extend(t * psbox.min()); bbox.extend(t * psbox.max()); } diff --git a/src/csgterm.h b/src/csgterm.h index 63d1240..1d9d9fd 100644 --- a/src/csgterm.h +++ b/src/csgterm.h @@ -23,11 +23,11 @@ public: std::string label; CSGTerm *left; CSGTerm *right; - double m[16]; + Transform3d m; double color[4]; int refcounter; - CSGTerm(const shared_ptr &polyset, const double matrix[16], const double color[4], const std::string &label); + CSGTerm(const shared_ptr &polyset, const Transform3d &matrix, const double color[4], const std::string &label); CSGTerm(type_e type, CSGTerm *left, CSGTerm *right); CSGTerm *normalize(); @@ -42,14 +42,14 @@ class CSGChain { public: std::vector > polysets; - std::vector matrices; + std::vector matrices; std::vector colors; std::vector types; std::vector labels; CSGChain(); - void add(const shared_ptr &polyset, double *m, double *color, CSGTerm::type_e type, std::string label); + void add(const shared_ptr &polyset, const Transform3d &m, double *color, CSGTerm::type_e type, std::string label); void import(CSGTerm *term, CSGTerm::type_e type = CSGTerm::TYPE_UNION); std::string dump(); diff --git a/src/linalg.h b/src/linalg.h index 60a706f..06991cf 100644 --- a/src/linalg.h +++ b/src/linalg.h @@ -6,5 +6,8 @@ using Eigen::Vector3d; typedef Eigen::AlignedBox BoundingBox; +using Eigen::Matrix3f; +using Eigen::Matrix3d; +using Eigen::Transform3d; #endif diff --git a/src/polyset.cc b/src/polyset.cc index ec0cdf9..1d31005 100644 --- a/src/polyset.cc +++ b/src/polyset.cc @@ -31,7 +31,7 @@ #include #include #endif -#include +#include "linalg.h" #include #include @@ -112,13 +112,9 @@ static void gl_draw_triangle(GLint *shaderinfo, const Vector3d &p0, const Vector } } -void PolySet::render_surface(colormode_e colormode, csgmode_e csgmode, double *m, GLint *shaderinfo) const +void PolySet::render_surface(colormode_e colormode, csgmode_e csgmode, const Transform3d &m, GLint *shaderinfo) const { - Eigen::Matrix3f m3f; - m3f << m[0], m[4], m[8], - m[1], m[5], m[9], - m[2], m[6], m[10]; - bool mirrored = m3f.determinant() < 0; + bool mirrored = m.matrix().determinant() < 0; if (colormode == COLORMODE_MATERIAL) { // FIXME: Reenable/rewrite - don't be dependant on GUI diff --git a/src/polyset.h b/src/polyset.h index 2fe1c1f..57f5057 100644 --- a/src/polyset.h +++ b/src/polyset.h @@ -45,7 +45,7 @@ public: CSGMODE_HIGHLIGHT_DIFFERENCE = 22 }; - void render_surface(colormode_e colormode, csgmode_e csgmode, double *m, GLint *shaderinfo = NULL) const; + void render_surface(colormode_e colormode, csgmode_e csgmode, const Transform3d &m, GLint *shaderinfo = NULL) const; void render_edges(colormode_e colormode, csgmode_e csgmode) const; }; diff --git a/src/state.h b/src/state.h index 69aee87..5dc74df 100644 --- a/src/state.h +++ b/src/state.h @@ -2,13 +2,14 @@ #define STATE_H_ #include +#include "linalg.h" class State { public: State(const class AbstractNode *parent) : parentnode(parent), isprefix(false), ispostfix(false), numchildren(0) { - for (int i=0;i<16;i++) this->m[i] = i % 5 == 0 ? 1.0 : 0.0; + m = Transform3d::Identity(); for (int i=0;i<4;i++) this->c[i] = -1.0; } virtual ~State() {} @@ -17,14 +18,14 @@ public: void setPostfix(bool on) { this->ispostfix = on; } void setNumChildren(unsigned int numc) { this->numchildren = numc; } void setParent(const AbstractNode *parent) { this->parentnode = parent; } - void setMatrix(const double m[16]) { memcpy(this->m, m, 16*sizeof(double)); } + void setMatrix(const Transform3d &m) { this->m = m; } void setColor(const double c[4]) { memcpy(this->c, c, 4*sizeof(double)); } bool isPrefix() const { return this->isprefix; } bool isPostfix() const { return this->ispostfix; } unsigned int numChildren() const { return this->numchildren; } const AbstractNode *parent() const { return this->parentnode; } - const double *matrix() const { return this->m; } + const Transform3d &matrix() const { return this->m; } const double *color() const { return this->c; } private: @@ -34,7 +35,7 @@ private: unsigned int numchildren; // Transformation matrix and color. FIXME: Generalize such state variables? - double m[16]; + Transform3d m; double c[4]; }; diff --git a/src/transform.cc b/src/transform.cc index 88f473f..eda69c2 100644 --- a/src/transform.cc +++ b/src/transform.cc @@ -55,8 +55,7 @@ AbstractNode *TransformModule::evaluate(const Context *ctx, const ModuleInstanti { TransformNode *node = new TransformNode(inst); - for (int i = 0; i < 16; i++) - node->matrix[i] = i % 5 == 0 ? 1.0 : 0.0; + node->matrix = Transform3d::Identity(); std::vector argnames; std::vector argexpr; @@ -86,82 +85,50 @@ AbstractNode *TransformModule::evaluate(const Context *ctx, const ModuleInstanti if (this->type == SCALE) { + Vector3d scalevec(1,1,1); Value v = c.lookup_variable("v"); - v.getnum(node->matrix[0]); - v.getnum(node->matrix[5]); - v.getnum(node->matrix[10]); - v.getv3(node->matrix[0], node->matrix[5], node->matrix[10]); - if (node->matrix[10] <= 0) - node->matrix[10] = 1; + v.getnum(scalevec[0]); + v.getnum(scalevec[1]); + v.getnum(scalevec[2]); + v.getv3(scalevec[0], scalevec[1], scalevec[2]); + if (scalevec[2] == 0) scalevec[2] = 1; + node->matrix.scale(scalevec); } else if (this->type == ROTATE) { Value val_a = c.lookup_variable("a"); if (val_a.type == Value::VECTOR) { - for (size_t i = 0; i < 3 && i < val_a.vec.size(); i++) { - double a; - val_a.vec[i]->getnum(a); - double c = cos(a*M_PI/180.0); - double s = sin(a*M_PI/180.0); - double x = i == 0, y = i == 1, z = i == 2; - double mr[16] = { - x*x*(1-c)+c, - y*x*(1-c)+z*s, - z*x*(1-c)-y*s, - 0, - x*y*(1-c)-z*s, - y*y*(1-c)+c, - z*y*(1-c)+x*s, - 0, - x*z*(1-c)+y*s, - y*z*(1-c)-x*s, - z*z*(1-c)+c, - 0, - 0, 0, 0, 1 - }; - double m[16]; - for (int x = 0; x < 4; x++) - for (int y = 0; y < 4; y++) - { - m[x+y*4] = 0; - for (int i = 0; i < 4; i++) - m[x+y*4] += node->matrix[i+y*4] * mr[x+i*4]; - } - for (int i = 0; i < 16; i++) - node->matrix[i] = m[i]; + Eigen::AngleAxisd rotx, roty, rotz; + double a; + if (val_a.vec.size() > 0) { + val_a.vec[0]->getnum(a); + rotx = Eigen::AngleAxisd(a*M_PI/180, Vector3d::UnitX()); } + if (val_a.vec.size() > 1) { + val_a.vec[1]->getnum(a); + roty = Eigen::AngleAxisd(a*M_PI/180, Vector3d::UnitY()); + } + if (val_a.vec.size() > 2) { + val_a.vec[2]->getnum(a); + rotz = Eigen::AngleAxisd(a*M_PI/180, Vector3d::UnitZ()); + } + node->matrix.rotate(rotz * roty * rotx); } else { Value val_v = c.lookup_variable("v"); - double a = 0, x = 0, y = 0, z = 1; + double a = 0; val_a.getnum(a); - if (val_v.getv3(x, y, z)) { - if (x != 0.0 || y != 0.0 || z != 0.0) { - double sn = 1.0 / sqrt(x*x + y*y + z*z); - x *= sn, y *= sn, z *= sn; - } + Vector3d axis(0,0,1); + if (val_v.getv3(axis[0], axis[1], axis[2])) { + if (axis.squaredNorm() > 0) axis.normalize(); } - if (x != 0.0 || y != 0.0 || z != 0.0) - { - double c = cos(a*M_PI/180.0); - double s = sin(a*M_PI/180.0); - - node->matrix[ 0] = x*x*(1-c)+c; - node->matrix[ 1] = y*x*(1-c)+z*s; - node->matrix[ 2] = z*x*(1-c)-y*s; - - node->matrix[ 4] = x*y*(1-c)-z*s; - node->matrix[ 5] = y*y*(1-c)+c; - node->matrix[ 6] = z*y*(1-c)+x*s; - - node->matrix[ 8] = x*z*(1-c)+y*s; - node->matrix[ 9] = y*z*(1-c)-x*s; - node->matrix[10] = z*z*(1-c)+c; + if (axis.squaredNorm() > 0) { + node->matrix = Eigen::AngleAxisd(a*M_PI/180, axis); } } } @@ -179,23 +146,20 @@ AbstractNode *TransformModule::evaluate(const Context *ctx, const ModuleInstanti if (x != 0.0 || y != 0.0 || z != 0.0) { - node->matrix[ 0] = 1-2*x*x; - node->matrix[ 1] = -2*y*x; - node->matrix[ 2] = -2*z*x; - - node->matrix[ 4] = -2*x*y; - node->matrix[ 5] = 1-2*y*y; - node->matrix[ 6] = -2*z*y; - - node->matrix[ 8] = -2*x*z; - node->matrix[ 9] = -2*y*z; - node->matrix[10] = 1-2*z*z; + Eigen::Matrix4d m; + m << 1-2*x*x, -2*y*x, -2*z*x, 0, + -2*x*y, 1-2*y*y, -2*z*y, 0, + -2*x*z, -2*y*z, 1-2*z*z, 0, + 0, 0, 0, 1; + node->matrix = m; } } else if (this->type == TRANSLATE) { Value v = c.lookup_variable("v"); - v.getv3(node->matrix[12], node->matrix[13], node->matrix[14]); + Vector3d translatevec(0,0,0); + v.getv3(translatevec[0], translatevec[1], translatevec[2]); + node->matrix.translate(translatevec); } else if (this->type == MULTMATRIX) { @@ -204,7 +168,7 @@ AbstractNode *TransformModule::evaluate(const Context *ctx, const ModuleInstanti for (int i = 0; i < 16; i++) { size_t x = i / 4, y = i % 4; if (y < v.vec.size() && v.vec[y]->type == Value::VECTOR && x < v.vec[y]->vec.size()) - v.vec[y]->vec[x]->getnum(node->matrix[i]); + v.vec[y]->vec[x]->getnum(node->matrix(y, x)); } } } @@ -224,7 +188,7 @@ std::string TransformNode::toString() const stream << "["; for (int i=0;i<4;i++) { // FIXME: The 0 test is to avoid a leading minus before a single 0 (cosmetics) - stream << ((this->matrix[i*4+j]==0)?0:this->matrix[i*4+j]); + stream << ((this->matrix(j, i)==0)?0:this->matrix(j, i)); if (i != 3) stream << ", "; } stream << "]"; diff --git a/src/transformnode.h b/src/transformnode.h index 9d822cb..29c6d43 100644 --- a/src/transformnode.h +++ b/src/transformnode.h @@ -3,6 +3,7 @@ #include "node.h" #include "visitor.h" +#include "linalg.h" class TransformNode : public AbstractNode { @@ -14,7 +15,7 @@ public: virtual std::string toString() const; virtual std::string name() const; - double matrix[16]; + Transform3d matrix; }; #endif -- cgit v0.10.1