diff options
Diffstat (limited to 'testdata')
48 files changed, 2751 insertions, 113 deletions
diff --git a/testdata/dxf/multiple-layers.dxf b/testdata/dxf/multiple-layers.dxf new file mode 100644 index 0000000..88b530f --- /dev/null +++ b/testdata/dxf/multiple-layers.dxf @@ -0,0 +1,2140 @@ +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 +Layer with a pretty long name including \ "special" /'\\ characters + 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 +3 + 0 +LAYER + 5 +10 +100 +AcDbSymbolTableRecord +100 +AcDbLayerTableRecord + 2 +0 + 70 +0 + 62 +7 +420 +0 + 6 +CONTINUOUS +370 +25 +390 +F + 0 +LAYER + 5 +43 +100 +AcDbSymbolTableRecord +100 +AcDbLayerTableRecord + 2 +noname + 70 +0 + 62 +7 +420 +0 + 6 +CONTINUOUS +370 +0 +390 +F + 0 +LAYER + 5 +44 +100 +AcDbSymbolTableRecord +100 +AcDbLayerTableRecord + 2 +Layer with a pretty long name including \ "special" /'\\ characters + 70 +0 + 62 +7 +420 +0 + 6 +CONTINUOUS +370 +0 +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 +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 +ENDSEC + 0 +SECTION + 2 +ENTITIES + 0 +LINE + 5 +45 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +-40.0 + 20 +40.0 + 30 +0.0 + 11 +40.0 + 21 +40.0 + 31 +0.0 + 0 +LINE + 5 +46 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +40.0 + 20 +40.0 + 30 +0.0 + 11 +40.0 + 21 +-40.0 + 31 +0.0 + 0 +LINE + 5 +47 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +40.0 + 20 +-40.0 + 30 +0.0 + 11 +-40.0 + 21 +-40.0 + 31 +0.0 + 0 +LINE + 5 +48 +100 +AcDbEntity +100 +AcDbLine + 8 +0 + 62 +256 +370 +-1 + 6 +ByLayer + 10 +-40.0 + 20 +-40.0 + 30 +0.0 + 11 +-40.0 + 21 +40.0 + 31 +0.0 + 0 +CIRCLE + 5 +49 +100 +AcDbEntity +100 +AcDbCircle + 8 +noname + 62 +256 +370 +-1 + 6 +ByLayer + 10 +0.0 + 20 +0.0 + 30 +0.0 + 40 +70.7106781186547551 + 0 +LINE + 5 +4A +100 +AcDbEntity +100 +AcDbLine + 8 +Layer with a pretty long name including \ "special" /'\\ characters + 62 +256 +370 +-1 + 6 +ByLayer + 10 +100.0 + 20 +0.0 + 30 +0.0 + 11 +50.0000000000000142 + 21 +86.6025403784438623 + 31 +0.0 + 0 +LINE + 5 +4B +100 +AcDbEntity +100 +AcDbLine + 8 +Layer with a pretty long name including \ "special" /'\\ characters + 62 +256 +370 +-1 + 6 +ByLayer + 10 +50.0000000000000142 + 20 +86.6025403784438623 + 30 +0.0 + 11 +-49.9999999999999858 + 21 +86.6025403784438907 + 31 +0.0 + 0 +LINE + 5 +4C +100 +AcDbEntity +100 +AcDbLine + 8 +Layer with a pretty long name including \ "special" /'\\ characters + 62 +256 +370 +-1 + 6 +ByLayer + 10 +-49.9999999999999858 + 20 +86.6025403784438907 + 30 +0.0 + 11 +-100.0000000000000142 + 21 +0.0000000000000122 + 31 +0.0 + 0 +LINE + 5 +4D +100 +AcDbEntity +100 +AcDbLine + 8 +Layer with a pretty long name including \ "special" /'\\ characters + 62 +256 +370 +-1 + 6 +ByLayer + 10 +-100.0000000000000142 + 20 +0.0000000000000122 + 30 +0.0 + 11 +-50.0000000000000497 + 21 +-86.6025403784438481 + 31 +0.0 + 0 +LINE + 5 +4E +100 +AcDbEntity +100 +AcDbLine + 8 +Layer with a pretty long name including \ "special" /'\\ characters + 62 +256 +370 +-1 + 6 +ByLayer + 10 +-50.0000000000000497 + 20 +-86.6025403784438481 + 30 +0.0 + 11 +49.9999999999998579 + 21 +-86.6025403784439618 + 31 +0.0 + 0 +LINE + 5 +4F +100 +AcDbEntity +100 +AcDbLine + 8 +Layer with a pretty long name including \ "special" /'\\ characters + 62 +256 +370 +-1 + 6 +ByLayer + 10 +49.9999999999998579 + 20 +-86.6025403784439618 + 30 +0.0 + 11 +100.0000000000000142 + 21 +-0.0000000000002021 + 31 +0.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 +50 + 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 +50 +100 +AcDbDictionary +281 +1 + 3 +DIMASSOC +350 +52 + 3 +HIDETEXT +350 +51 + 0 +DICTIONARYVAR + 5 +51 +100 +DictionaryVariables +280 +0 + 1 +2 + 0 +DICTIONARYVAR + 5 +52 +100 +DictionaryVariables +280 +0 + 1 +1 + 0 +ENDSEC + 0 +EOF diff --git a/testdata/scad/bugs/gridbug.scad b/testdata/scad/bugs/gridbug.scad new file mode 100644 index 0000000..678a22a --- /dev/null +++ b/testdata/scad/bugs/gridbug.scad @@ -0,0 +1,9 @@ +// This crashes OpenSCAD including 2011.06 in PolyReducer due to two vertices of +// a triangle evaluating to the same index +linear_extrude(height=2) + polygon(points=[[0, 0], + [1, 0], + [1.0014, 1], + [1, 1], + [0, 1]], + paths=[[0,1,2,3,4]]); diff --git a/testdata/scad/bugs/horn-torus.scad b/testdata/scad/bugs/horn-torus.scad new file mode 100644 index 0000000..f93a364 --- /dev/null +++ b/testdata/scad/bugs/horn-torus.scad @@ -0,0 +1,5 @@ +// This model causes a CGAL assertion in CGAL_Nef_polyhedron3(CGAL_Polyhedron) constructor. +// One cause of this error could be that the grid handling in PolySet degenerated the original +// mesh into a non-manifold one. + +rotate_extrude($fn = 24) translate ([ 1, 0, 0 ]) circle (r = 1); diff --git a/testdata/scad/bugs/minkowski-assert.scad b/testdata/scad/bugs/minkowski-assert.scad new file mode 100644 index 0000000..4ae81da --- /dev/null +++ b/testdata/scad/bugs/minkowski-assert.scad @@ -0,0 +1,8 @@ +minkowski() { + cube(20, center=true); + rotate([20, 30, 40]) + difference() { + cube(5, center=true); + cube([1, 1, 10], center=true); + } +} diff --git a/testdata/scad/bugs/polygon-touch.scad b/testdata/scad/bugs/polygon-touch.scad new file mode 100644 index 0000000..afa2938 --- /dev/null +++ b/testdata/scad/bugs/polygon-touch.scad @@ -0,0 +1,5 @@ +# Somehow the 2D union/tessellation algorithm doesn't support touching polygons +# Changing translate([-10,-10,0]) to translate([-9.99,-9.99,0]) works + +square([10,10]); +translate([-10,-10,0]) square([10,10]); diff --git a/testdata/scad/features/2d-3d.scad b/testdata/scad/features/2d-3d.scad new file mode 100644 index 0000000..ca9f966 --- /dev/null +++ b/testdata/scad/features/2d-3d.scad @@ -0,0 +1,3 @@ +// Test a mix of toplevel 2D and 3D objects +cube(); +translate([2,0,0]) square(); diff --git a/testdata/scad/features/assign-tests.scad b/testdata/scad/features/assign-tests.scad new file mode 100644 index 0000000..b86dabe --- /dev/null +++ b/testdata/scad/features/assign-tests.scad @@ -0,0 +1,6 @@ +for(i=[0:5]) { + translate([i*i/2,0,0]) { + cube(i); + translate([0,-5,0]) assign(f=1.0*i/2) cube(f); + } +} diff --git a/testdata/scad/features/background-modifier.scad b/testdata/scad/features/background-modifier.scad new file mode 100644 index 0000000..ec7b28d --- /dev/null +++ b/testdata/scad/features/background-modifier.scad @@ -0,0 +1,4 @@ +difference() { + sphere(r=10); + %cylinder(h=30, r=6, center=true); +} diff --git a/testdata/scad/features/child-tests.scad b/testdata/scad/features/child-tests.scad new file mode 100644 index 0000000..e4e3572 --- /dev/null +++ b/testdata/scad/features/child-tests.scad @@ -0,0 +1,34 @@ +$fn=16; + +module parent() { + for (i=[0:2]) { + translate([2.5*i,0,0]) child(i); + } +} + +// Normal +parent() { + sphere(); + cylinder(h=2, center=true); + cube(2, center=true); +} + +// No children +parent(); + +// Too few children +translate([0,3,0]) parent() { sphere(); } + +// No parameter to child +module parent2() { + child(); +} + +translate([2.5,3,0]) parent2() { cylinder(h=2, center=true); sphere(); } + +// Negative parameter to child +module parent3() { + child(-1); +} + +translate([5,3,0]) parent3() { cube(); sphere(); } diff --git a/testdata/scad/features/circle-tests.scad b/testdata/scad/features/circle-tests.scad new file mode 100644 index 0000000..6b54d55 --- /dev/null +++ b/testdata/scad/features/circle-tests.scad @@ -0,0 +1,10 @@ +circle(); +translate([0,3,0]) circle(1); +translate([5,1,0]) circle(r=3); +translate([0,-1,0]) circle(r=0); +translate([0,-3,0]) circle(1, $fn=4); +translate([3,-3,0]) circle(1, $fn=8); +translate([6,-3,0]) circle(1, $fn=12); +translate([0,-6,0]) circle(1, $fa=20, $fs=0.3); +translate([3,-6,0]) circle(1, $fa=30, $fs=0.3); +translate([6,-6,0]) circle(1, $fa=40, $fs=0.3); diff --git a/testdata/scad/features/color-tests.scad b/testdata/scad/features/color-tests.scad new file mode 100644 index 0000000..3ef2540 --- /dev/null +++ b/testdata/scad/features/color-tests.scad @@ -0,0 +1,15 @@ +// Empty +color(); +// No children +color() { } + +module object() cube([10,10,10]); + +translate([12,12,0]) object(); +color([1,0,0]) translate([24,12,0]) object(); +translate([0,12,0]) color("Purple") object(); +color([0,0,1,0.5]) object(); +translate([12,0,0]) color([0,0,1],0.5) object(); +translate([24,0,0]) color(c="Green",alpha=0.2) object(); +translate([-12,12,0]) color() object(); +translate([-12,0,0]) color(alpha=0.5) object(); diff --git a/testdata/scad/features/cube-tests.scad b/testdata/scad/features/cube-tests.scad new file mode 100644 index 0000000..ae2ead1 --- /dev/null +++ b/testdata/scad/features/cube-tests.scad @@ -0,0 +1,4 @@ +cube(); +cube([1,1,0]); cube([1,0,1]); cube([0,1,1]); cube([0,0,0]); +translate([2,0,0]) cube([2,3,1]); +translate([6,0,0]) cube([2,4,2], center=true); diff --git a/testdata/scad/features/cylinder-tests.scad b/testdata/scad/features/cylinder-tests.scad new file mode 100644 index 0000000..54e88cd --- /dev/null +++ b/testdata/scad/features/cylinder-tests.scad @@ -0,0 +1,15 @@ +cylinder(); +translate([1,0,0]) cylinder(r=0); +translate([2,0,0]) cylinder(r1=0, r2=0); +translate([0,-11,0]) cylinder(r=5); +translate([0,11,0]) cylinder(r=5, h=10, center=true); + +translate([11,-11,0]) cylinder(h=5, r1=5); +translate([11,0,0]) cylinder(h=5, r1=5, r2=0); +translate([11,11,0]) cylinder(h=8, r1=5, r2=5); + +translate([22,-11,0]) cylinder(h=5, r=5, r1=0, center=true); +translate([22,0,0]) cylinder(h=5, r=5, r2=0); +translate([22,11,0]) cylinder(h=15, r=5, r2=5); + +// FIXME: We could test $fs, $fa, $fn as well diff --git a/testdata/scad/features/difference-tests.scad b/testdata/scad/features/difference-tests.scad index f945246..4d82676 100644 --- a/testdata/scad/features/difference-tests.scad +++ b/testdata/scad/features/difference-tests.scad @@ -1,4 +1,30 @@ +// Empty +difference(); +// No children +difference() { } + difference() { - sphere(3); - cube([3,3,8], center=true); + cube([10,10,10], center=true); + cylinder(r=4, h=20, center=true); +} + +translate([12,0,0]) difference() { + cube([10,10,10], center=true); + cylinder(r=4, h=10, center=true); +} + +translate([0,12,0]) difference() { + cube([10,10,10], center=true); + cylinder(r=4, h=11, center=true); + rotate([0,90,0]) cylinder(r=4, h=11, center=true); +} + +translate([12,12,0]) difference() { + cube([10,10,10], center=true); + translate([0,0,7]) cylinder(r=4, h=4, center=true); +} + +translate([24,0,0]) difference() { + cube([10,10,10], center=true); + translate([0,0,6.99]) cylinder(r=4, h=4, center=true); } diff --git a/testdata/scad/features/disable-modifier.scad b/testdata/scad/features/disable-modifier.scad new file mode 100644 index 0000000..b47e074 --- /dev/null +++ b/testdata/scad/features/disable-modifier.scad @@ -0,0 +1,4 @@ +difference() { + *sphere(r=10); + cylinder(h=30, r=6, center=true); +} diff --git a/testdata/scad/features/for-nested-tests.scad b/testdata/scad/features/for-nested-tests.scad new file mode 100644 index 0000000..e3b5877 --- /dev/null +++ b/testdata/scad/features/for-nested-tests.scad @@ -0,0 +1,3 @@ +for(x=[0:3], y=[0:0.5:1], z=[0,2,3]) { + translate(10*[x,y,z]) sphere(r=3); +} diff --git a/testdata/scad/features/for-tests.scad b/testdata/scad/features/for-tests.scad new file mode 100644 index 0000000..fe36789 --- /dev/null +++ b/testdata/scad/features/for-tests.scad @@ -0,0 +1,41 @@ +// Empty +for(); +// No children +for(i=2) { } + +// Null +translate([-10,0,0]) for() cylinder(r=4); + +// Scalar +translate([10,0,0]) for(i=3) cylinder(r=i); + +// Range +for(r=[1:5]) translate([r*10-30,10,0]) cylinder(r=r); + +// Reverse +for(r=[5:1]) translate([r*10-30,20,0]) cylinder(r=r); + +// Step +for(r=[1:2:6]) translate([r*10-30,30,0]) difference() {cylinder(r=r, center=true); cylinder(r=r/2, h=2, center=true);} + +// Fractional step +for(r=[1.5:0.2:2.5]) translate([r*10-30,30,0]) cube([1, 4*r, 2], center=true); + +// Negative range, negative step +for(r=[5:-1:1]) translate([r*10-60,40,0]) cylinder(r=r); + +// Negative range, positive step +for(r=[5:1:1]) translate([r*10-30,40,0]) cylinder(r=r); + +// Zero step + +for(r=[1:0:5]) translate([r*10+60,40,0]) cylinder(r=r); + +// Negative step +for(r=[1:-1:5]) translate([r*10-30,50,0]) cylinder(r=r); + +// Illegal step value +for(r=[1:true:5]) translate([r*10-60,50,0]) cylinder(r=r); + +// Vector +for(r=[1,2,5]) translate([r*10-30,0,0]) cylinder(r=r); diff --git a/testdata/scad/features/highlight-modifier.scad b/testdata/scad/features/highlight-modifier.scad new file mode 100644 index 0000000..1156a88 --- /dev/null +++ b/testdata/scad/features/highlight-modifier.scad @@ -0,0 +1,4 @@ +difference() { + sphere(r=10); + #cylinder(h=30, r=6, center=true); +} diff --git a/testdata/scad/features/hull2-tests.scad b/testdata/scad/features/hull2-tests.scad new file mode 100644 index 0000000..3bea3c5 --- /dev/null +++ b/testdata/scad/features/hull2-tests.scad @@ -0,0 +1,30 @@ +module convex2dSimple() { + hull() { + translate([15,10]) circle(10); + circle(10); + } +} + +module concave2dSimple() { + hull() { + translate([15,10]) square(2); + translate([15,0]) square(2); + square(2); + } +} + +// Works correctly +module convex2dHole() { + hull() { + translate([15,10,0]) circle(10); + difference() { + circle(10); + circle(5); + } + } +} + + +convex2dHole(); +translate([40,0,0]) convex2dSimple(); +translate([0,-20,0]) concave2dSimple(); diff --git a/testdata/scad/features/hull-tests.scad b/testdata/scad/features/hull3-tests.scad index 3114ac5..2bd7d73 100644 --- a/testdata/scad/features/hull-tests.scad +++ b/testdata/scad/features/hull3-tests.scad @@ -1,22 +1,3 @@ -// Works correctly -module convex2dSimple() { - hull() { - translate([15,10]) circle(10); - circle(10); - } -} - -// Works correctly -module convex2dHole() { - hull() { - translate([15,10,0]) circle(10); - difference() { - circle(10); - circle(5); - } - } -} - // 3d not currently implemented module convex3dSimple() { hull() { @@ -36,8 +17,11 @@ module convex3dHole() { } } - -convex2dHole(); -translate([40,0,0]) convex2dSimple(); translate([0,40,0]) convex3dHole(); translate([40,40,0]) convex3dSimple(); + +// Empty +hull(); +// No children +hull() { } + diff --git a/testdata/scad/features/ifelse-tests.scad b/testdata/scad/features/ifelse-tests.scad new file mode 100644 index 0000000..d8c777b --- /dev/null +++ b/testdata/scad/features/ifelse-tests.scad @@ -0,0 +1,44 @@ +if (true) cube(2, true); +else cylinder(r=1,h=2); + +translate([3,0,0]) + if (false) cylinder(r=1,h=2); + else cube(2, true); + +translate([0,3,0]) + if (false) cylinder(r=1,h=2); + else if (true) cube(2, true); + else sphere(); + +translate([3,3,0]) + if (false) cylinder(r=1,h=2); + else if (false) sphere(); + else cube(2, true); + +translate([6,0,0]) + if (0) cylinder(r=1,h=2); + else cube(2, true); + +translate([6,3,0]) + if (1) cube(2, true); + else cylinder(r=1,h=2); + +translate([9,0,0]) + if ("") cylinder(r=1,h=2); + else cube(2, true); + +translate([9,3,0]) + if ("hello") cube(2, true); + else cylinder(r=1,h=2); + +translate([12,0,0]) + if ([]) cylinder(r=1,h=2); + else cube(2, true); + +translate([12,3,0]) + if ([1,2,3]) cube(2, true); + else cylinder(r=1,h=2); + +translate([15,0,0]) + if (ILLEGAL) cylinder(r=1,h=2); + else cube(2, true); diff --git a/testdata/scad/features/import_dxf-tests.scad b/testdata/scad/features/import_dxf-tests.scad new file mode 100644 index 0000000..814a46c --- /dev/null +++ b/testdata/scad/features/import_dxf-tests.scad @@ -0,0 +1,9 @@ +import_dxf(); +translate([-210,0,0]) import_dxf(file="../../dxf/polygons.dxf"); +translate([-210,0,0]) import_dxf(file="../../dxf/polygons.dxf", origin=[0,110]); +translate([-210,0,0]) import_dxf(file="../../dxf/polygons.dxf", origin=[110,110], scale=0.5); +import_dxf(file="../../dxf/multiple-layers.dxf"); +translate([-200,200,0]) import_dxf(file="../../dxf/multiple-layers.dxf", layer="0"); +translate([0,200,0]) import_dxf(file="../../dxf/multiple-layers.dxf", layer="0"); +translate([200,200,0]) import_dxf(file="../../dxf/multiple-layers.dxf", layer="noname"); +translate([0,200,0]) import_dxf(file="../../dxf/multiple-layers.dxf", layer="Layer with a pretty long name including \\ \"special\" /'\\\\ characters"); diff --git a/testdata/scad/features/include test6.scad b/testdata/scad/features/include test6.scad index 7a79456..0d96b26 100644 --- a/testdata/scad/features/include test6.scad +++ b/testdata/scad/features/include test6.scad @@ -1,4 +1,7 @@ module test6() { - echo("included from include test6.scad"); + difference() { + cube(center=true); + cylinder(r=0.4, h=2, center=true); + } } diff --git a/testdata/scad/features/include-test5.scad b/testdata/scad/features/include-test5.scad index 4f6e656..e4393cb 100644 --- a/testdata/scad/features/include-test5.scad +++ b/testdata/scad/features/include-test5.scad @@ -1,4 +1,4 @@ module test5() { - echo("included from include-test5.scad"); + sphere(r=0.5, $fn=8); } diff --git a/testdata/scad/features/include-test.scad b/testdata/scad/features/include-tests.scad index 5db02d7..36c04ca 100644 --- a/testdata/scad/features/include-test.scad +++ b/testdata/scad/features/include-tests.scad @@ -28,13 +28,13 @@ include <> module test1() { test2(); - test3(); - test4(); - test5(); - test6(); + translate([2,0,0]) test3(); + translate([2,-2,0]) test4(); + translate([-2,0,0]) test5(); + translate([-2,-2,0]) test6(); //Just to give a top level object - sphere(1); + translate([0,-2,0]) sphere(0.7, $fn=16); } test1(); diff --git a/testdata/scad/features/intersection-tests.scad b/testdata/scad/features/intersection-tests.scad index 4101b03..e53f3c9 100644 --- a/testdata/scad/features/intersection-tests.scad +++ b/testdata/scad/features/intersection-tests.scad @@ -1,4 +1,41 @@ +// Empty +intersection(); + +// No children +intersection() { } + intersection() { - sphere(3); - cube([3,3,8], center=true); + sphere(r=5); + translate([0,0,3]) cube([4,4,6], center=true); +} + +translate([0,12,0]) intersection() { + cube([10,10,10], center=true); + cylinder(r=4, h=12, center=true); +} + +translate([12,0,0]) intersection() { + cube([10,10,10], center=true); + cylinder(r=4, h=12, center=true); + rotate([0,90,0]) cylinder(r=4, h=12, center=true); +} + +translate([12,12,0]) intersection() { + cube([10,10,10], center=true); + translate([0,0,7]) cylinder(r=4, h=4, center=true); +} + +translate([24,0,0]) intersection() { + cube([10,10,10], center=true); + translate([0,0,6.99]) cylinder(r=4, h=4, center=true); +} + +translate([-12,0,0]) intersection() { + cube([10,10,10], center=true); + translate([0,-10,-10]) cube([10,10,10], center=true); +} + +translate([-12,12,0]) intersection() { + cube([10,10,10], center=true); + translate([0,-9.99,-9.99]) cube([10,10,10], center=true); } diff --git a/testdata/scad/features/intersection_for-tests.scad b/testdata/scad/features/intersection_for-tests.scad new file mode 100644 index 0000000..6ab1a89 --- /dev/null +++ b/testdata/scad/features/intersection_for-tests.scad @@ -0,0 +1,10 @@ +// Empty +intersection_for(); +// No children +intersection_for(i=1) { } + +intersection_for(i = [[0, 0, 0], + [10, 20, 300], + [200, 40, 57], + [20, 88, 57]]) + rotate(i) cube([100, 20, 20], center = true); diff --git a/testdata/scad/features/linear_extrude-tests.scad b/testdata/scad/features/linear_extrude-tests.scad index af050fb..67de8e6 100644 --- a/testdata/scad/features/linear_extrude-tests.scad +++ b/testdata/scad/features/linear_extrude-tests.scad @@ -1,7 +1,13 @@ +// Empty +rotate_extrude(); +// No children +rotate_extrude() { } +// 3D child +rotate_extrude() { cube(); } + linear_extrude(height=10) square([10,10]); -translate([19,5,0]) linear_extrude(height=10) circle(5); -translate([31.5,2.5,0]) linear_extrude(height=10) polygon(points = [[-5,-2.5], [5,-2.5], [0,2.5]]); +translate([19,5,0]) linear_extrude(height=10, center=true) difference() {circle(5); circle(3);} +translate([31.5,2.5,0]) linear_extrude(height=10, twist=-45) polygon(points = [[-5,-2.5], [5,-2.5], [0,2.5]]); -translate([0,-12,0]) linear_extrude(height=20, twist=45) square([10,10]); -translate([19,-7,0]) linear_extrude(height=20, twist=90) circle(5); -translate([31.5,-9.5,0]) linear_extrude(height=20, twist=180) polygon(points = [[-5,-2.5], [5,-2.5], [0,2.5]]); +translate([0,20,0]) linear_extrude(height=20, twist=45, slices=2) square([10,10]); +translate([19,20,0]) linear_extrude(height=20, twist=45, slices=10) square([10,10]); diff --git a/testdata/scad/features/minkowski-tests.scad b/testdata/scad/features/minkowski-tests.scad deleted file mode 100644 index 6d0dade..0000000 --- a/testdata/scad/features/minkowski-tests.scad +++ /dev/null @@ -1,67 +0,0 @@ - -// Rounded box using 3d minkowski -module roundedBox3dSimple() { - minkowski() { - cube([10,10,5]); - cylinder(r=5, h=5); - } -} - -// Currently segfaults -module roundedBox3dCut() { - minkowski() { - difference() { - cube([10,10,5]); - cube([5,5,5]); - } - cylinder(r=5, h=5); - } -} - -// Currently segfaults -module roundedBox3dHole() { - minkowski() { - difference() { - cube([10,10,5]); - translate([2,2,-2]) cube([6,6,10]); - } - cylinder(r=2); - } -} - -// Works correctly -module roundedBox2dSimple() { - minkowski() { - square([10,10]); - circle(r=5); - } -} - -// Works correctly -module roundedBox2dCut() { - minkowski() { - difference() { - square([10,10]); - square([5,5]); - } - circle(r=5); - } -} - -// Not quite correct, result does not contain a hole, since the impl currently returns the outer boundary of the polygon_with_holes. -module roundedBox2dHole() { - minkowski() { - difference() { - square([10,10]); - translate([2,2]) square([6,6]); - } - circle(r=2); - } -} - -translate([-25,0,0]) roundedBox2dHole(); -translate([0,0,0]) roundedBox2dCut(); -translate([25,0,0]) roundedBox2dSimple(); -translate([-25,25,0]) roundedBox3dHole(); -translate([0,25,0]) roundedBox3dCut(); -translate([25,25,0]) roundedBox3dSimple(); diff --git a/testdata/scad/features/minkowski2-tests.scad b/testdata/scad/features/minkowski2-tests.scad new file mode 100644 index 0000000..08f3d98 --- /dev/null +++ b/testdata/scad/features/minkowski2-tests.scad @@ -0,0 +1,31 @@ +module roundedBox2dSimple() { + minkowski() { + square([10,10]); + circle(r=5); + } +} + +module roundedBox2dCut() { + minkowski() { + difference() { + square([10,10]); + square([5,5]); + } + circle(r=5); + } +} + +// Not quite correct, result does not contain a hole, since the impl currently returns the outer boundary of the polygon_with_holes. +module roundedBox2dHole() { + minkowski() { + difference() { + square([10,10], center=true); + square([8,8], center=true); + } + circle(r=2); + } +} + +translate([-20,5,0]) roundedBox2dHole(); +translate([0,0,0]) roundedBox2dCut(); +translate([25,0,0]) roundedBox2dSimple(); diff --git a/testdata/scad/features/minkowski3-tests.scad b/testdata/scad/features/minkowski3-tests.scad new file mode 100644 index 0000000..0451b57 --- /dev/null +++ b/testdata/scad/features/minkowski3-tests.scad @@ -0,0 +1,35 @@ +module roundedBox3dSimple() { + minkowski() { + cube([10,10,5]); + cylinder(r=5, h=5); + } +} + +module roundedBox3dCut() { + minkowski() { + difference() { + cube([10,10,5]); + cube([5,5,5]); + } + cylinder(r=5, h=5); + } +} + +module roundedBox3dHole() { + minkowski() { + difference() { + cube([10,10,5], center=true); + cube([8,8,10], center=true); + } + cylinder(r=2); + } +} + +translate([-20,30,0]) roundedBox3dHole(); +translate([0,25,0]) roundedBox3dCut(); +translate([25,25,0]) roundedBox3dSimple(); + +// Empty +minkowski(); +// No children +minkowski() { } diff --git a/testdata/scad/features/polygon-tests.scad b/testdata/scad/features/polygon-tests.scad new file mode 100644 index 0000000..ab3a345 --- /dev/null +++ b/testdata/scad/features/polygon-tests.scad @@ -0,0 +1,17 @@ +polygon(); +polygon([]); +polygon([[],[]]); +polygon([[[]]]); +translate([2,0,0]) polygon([[0,0], [1,0], [1,1]]); +translate([0,2,0]) polygon([[0,0]]); +translate([2,2,0]) polygon([[0,0],[1,1]]); +translate([2,2,0]) polygon([[0,0],[1,1],[2,2]]); +translate([0,-2,0]) polygon(points=[[0,0], [1,0], [1,1], [0,1]]); +translate([0,-4,0]) polygon(points=[[0,0], [1,0], [1,1], [0,1]], paths=[]); +translate([2,-2,0]) polygon([[0,0], [1,0], [0.8,0.5], [1,1], [0,1]]); + +points = [[0,0], [0.5,-0.2], [1,0], [1.2,0.5], [1,1], [0.5,1.2], [0,1], [-0.2,0.5]]; +translate([-2,0,0]) polygon(points); +translate([-2,-2,0]) polygon(points=points, paths=[[0,1,2,3], [4,5,6,7]]); + +// FIXME: convexity diff --git a/testdata/scad/features/projection-tests.scad b/testdata/scad/features/projection-tests.scad index 619aa01..e1b05c7 100644 --- a/testdata/scad/features/projection-tests.scad +++ b/testdata/scad/features/projection-tests.scad @@ -1,3 +1,10 @@ +// Empty +projection(); +// No children +projection() { } +// 2D child +projection(cut=true) { square(); } + linear_extrude(height=20) projection(cut=false) sphere(r=10); translate([22,0,0]) linear_extrude(height=20) projection(cut=true) translate([0,0,9]) sphere(r=10); translate([44,0,0]) linear_extrude(height=20) projection(cut=true) translate([0,0,7]) sphere(r=10); diff --git a/testdata/scad/features/render-tests.scad b/testdata/scad/features/render-tests.scad new file mode 100644 index 0000000..5fcb026 --- /dev/null +++ b/testdata/scad/features/render-tests.scad @@ -0,0 +1,36 @@ +module edgeprofile() +{ + difference() { + cube([20, 20, 150], center = true); + translate([-10, -10, 0]) cylinder(h = 80, r = 10, center = true); + } +} + +module rendered_edgeprofile() +{ + render(convexity = 2) edgeprofile(); +} + +module mycube() { + difference() { + cube(100, center = true); + translate([ -50, -50, 0 ]) rotate(180, [0, 0, 1]) edgeprofile(); + translate([ 50, -50, 0 ]) rotate(270, [0, 0, 1]) edgeprofile(); + } +} + +module rendered_mycube() { + difference() { + cube(100, center = true); + translate([ -50, -50, 0 ]) rotate(180, [0, 0, 1]) rendered_edgeprofile(); + translate([ 50, -50, 0 ]) rotate(270, [0, 0, 1]) rendered_edgeprofile(); + } +} + +// Empty +render(); +// No children +render() { } + +mycube(); +translate([110,0,0]) rendered_mycube(); diff --git a/testdata/scad/features/root-modifier.scad b/testdata/scad/features/root-modifier.scad new file mode 100644 index 0000000..6c36433 --- /dev/null +++ b/testdata/scad/features/root-modifier.scad @@ -0,0 +1,4 @@ +difference() { + sphere(r=10); + !cylinder(h=30, r=6, center=true); +} diff --git a/testdata/scad/features/rotate_extrude-tests.scad b/testdata/scad/features/rotate_extrude-tests.scad index 7bbcef0..347bc78 100644 --- a/testdata/scad/features/rotate_extrude-tests.scad +++ b/testdata/scad/features/rotate_extrude-tests.scad @@ -1,2 +1,30 @@ +// Empty +rotate_extrude(); +// No children +rotate_extrude() { } +// 3D child +rotate_extrude() { cube(); } + +// Normal rotate_extrude() translate([20,0,0]) circle(r=10); +// Sweep of polygon with hole +translate([50,-20,0]) { + difference() { + rotate_extrude() translate([20,0,0]) difference() { + circle(r=10); circle(r=8); + } + translate([-50,0,0]) cube([100,100,100], center=true); + } +} + +// Alternative, difference between two solid sweeps +translate([50,50,0]) { + difference() { + difference() { + rotate_extrude() translate([20,0,0]) circle(r=10); + rotate_extrude() translate([20,0,0]) circle(r=8); + } + translate([-50,0,0]) cube([100,100,100], center=true); + } +} diff --git a/testdata/scad/features/sphere-tests.scad b/testdata/scad/features/sphere-tests.scad index f87aa26..e666c1b 100644 --- a/testdata/scad/features/sphere-tests.scad +++ b/testdata/scad/features/sphere-tests.scad @@ -1,4 +1,10 @@ -sphere(5); -translate([0,12,0]) sphere(5, $fa=5, $fs=0.5); -translate([12,0,0]) sphere(r=6); -translate([12,12,0]) sphere(r=6, $fn=5); +sphere(); +translate([2,0,0]) sphere(r=0); +translate([0,11,0]) sphere(5); +translate([0,-11,0]) sphere(r=5); +translate([11,-11,0]) sphere(5, $fn=5); +translate([11,0,0]) sphere(5, $fn=10); +translate([11,11,0]) sphere(5, $fn=15); +translate([22,-11, 0]) sphere(5, $fa=20, $fs=0.3); +translate([22, 0, 0]) sphere(5, $fa=30, $fs=0.3); +translate([22, 11, 0]) sphere(5, $fa=40, $fs=0.3); diff --git a/testdata/scad/features/square-tests.scad b/testdata/scad/features/square-tests.scad new file mode 100644 index 0000000..57ec1c4 --- /dev/null +++ b/testdata/scad/features/square-tests.scad @@ -0,0 +1,8 @@ +square(); +translate([2,0,0]) square([1,1], true); +translate([4,0,0]) square(size=[1,1], center=true); +translate([6,0,0]) square([0,0], true); +translate([0,2,0]) square([1,0], true); +translate([2,2,0]) square([0,1], true); +translate([4,2,0]) square([1,2], true); +translate([6,2,0]) square([2,1], true); diff --git a/testdata/scad/features/sub1/sub2/sub3/include-test4.scad b/testdata/scad/features/sub1/sub2/sub3/include-test4.scad index 1cb7eab..c13368c 100644 --- a/testdata/scad/features/sub1/sub2/sub3/include-test4.scad +++ b/testdata/scad/features/sub1/sub2/sub3/include-test4.scad @@ -1,4 +1,4 @@ module test4() { - echo("included from include-test4.scad"); + cylinder(r=0.5, $fn=10, center=true); } diff --git a/testdata/scad/features/sub1/sub2/sub3/sub4/include-test2.scad b/testdata/scad/features/sub1/sub2/sub3/sub4/include-test2.scad index 9f4c963..140c4ed 100644 --- a/testdata/scad/features/sub1/sub2/sub3/sub4/include-test2.scad +++ b/testdata/scad/features/sub1/sub2/sub3/sub4/include-test2.scad @@ -6,5 +6,5 @@ include <../include-test4.scad> module test2 () { - echo("included from include-test2.scad"); + cube(center=true); } diff --git a/testdata/scad/features/sub1/sub2/sub3/sub4/include-test3.scad b/testdata/scad/features/sub1/sub2/sub3/sub4/include-test3.scad index 2f67e93..6e3537e 100644 --- a/testdata/scad/features/sub1/sub2/sub3/sub4/include-test3.scad +++ b/testdata/scad/features/sub1/sub2/sub3/sub4/include-test3.scad @@ -1,4 +1,4 @@ module test3() { - echo("included from include-test3.scad"); + cylinder(r1=0.7, r2=0.2, center=true); } diff --git a/testdata/scad/features/surface-tests.scad b/testdata/scad/features/surface-tests.scad index 32072fa..5a67293 100644 --- a/testdata/scad/features/surface-tests.scad +++ b/testdata/scad/features/surface-tests.scad @@ -1 +1,2 @@ -surface("surface.dat"); +surface(); +surface("surface.dat", center=true); diff --git a/testdata/scad/testcolornames.scad b/testdata/scad/features/testcolornames.scad index b9ad334..b9ad334 100644 --- a/testdata/scad/testcolornames.scad +++ b/testdata/scad/features/testcolornames.scad diff --git a/testdata/scad/features/transform-tests.scad b/testdata/scad/features/transform-tests.scad new file mode 100644 index 0000000..a591695 --- /dev/null +++ b/testdata/scad/features/transform-tests.scad @@ -0,0 +1,18 @@ +module mycyl() { + cylinder(r1=10, r2=0, h=20); +} + +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(); +rotate(v=[-1,0,0], a=45) mycyl(); +multmatrix([[1,0,0,-25], + [0,1,0,0], + [0,0,1,0], + [0,0,0,1]]) mycyl(); +multmatrix([[1,0.4,0.1,-25], + [0.4,0.8,0,-25], + [0.2,0.2,0.5,0], + [0,0,0,1]]) mycyl(); + +//FIXME: mirror()
\ No newline at end of file diff --git a/testdata/scad/features/union-tests.scad b/testdata/scad/features/union-tests.scad new file mode 100644 index 0000000..718aa8c --- /dev/null +++ b/testdata/scad/features/union-tests.scad @@ -0,0 +1,29 @@ +translate([-12,0,0]) union() { + cube([10,10,10]); + translate([4,4,8]) cube([2,2,10]); +} + +union() { + cube([10,10,10]); + translate([0,0,10]) cube([2,2,10]); +} + +translate([12,0,0]) union() { + cube([10,10,10]); + translate([0,0,11]) cube([2,2,10]); +} + +translate([24,0,0]) union() { + cube([10,10,10]); + translate([4,4,10]) cube([2,2,10]); +} + +translate([-12,12,0]) union() { + cube([10,10,10]); + translate([-2,10,10]) cube([2,2,10]); +} + +translate([0,12,0]) union() { + cube([10,10,10]); + translate([0,10,10]) cube([2,2,10]); +} diff --git a/testdata/scad/minimal/allfunctions.scad b/testdata/scad/minimal/allfunctions.scad new file mode 100644 index 0000000..e58bd07 --- /dev/null +++ b/testdata/scad/minimal/allfunctions.scad @@ -0,0 +1,24 @@ +a = abs(); +a = sign(); +a = rands(); +a = min(); +a = max(); +a = sin(); +a = cos(); +a = asin(); +a = acos(); +a = tan(); +a = atan(); +a = atan2(); +a = round(); +a = ceil(); +a = floor(); +a = pow(); +a = sqrt(); +a = exp(); +a = log(); +a = ln(); +a = str(); +a = lookup(); +a = dxf_dim(); +a = dxf_cross(); diff --git a/testdata/scad/minimal/allmodules.scad b/testdata/scad/minimal/allmodules.scad index a940947..4395fd7 100644 --- a/testdata/scad/minimal/allmodules.scad +++ b/testdata/scad/minimal/allmodules.scad @@ -15,6 +15,7 @@ dxf_linear_extrude(); linear_extrude(); dxf_rotate_extrude(); rotate_extrude(); +import(); import_stl(); import_off(); import_dxf(); diff --git a/testdata/scad/minimal/import.scad b/testdata/scad/minimal/import.scad new file mode 100644 index 0000000..6f375fe --- /dev/null +++ b/testdata/scad/minimal/import.scad @@ -0,0 +1 @@ +import(); |