

Snap is used to precisely attach a draw object to another object. Basic draw tool: line, circle, and arc.Select enclosed objects (when moving left to right) or select any partially enclosed objects (moving right to left). Using world units and a coordinate system instead of screen units and a coordinate system.So, what I have implemented so far is the basic framework and only the most basic tools, but it does demonstrate how a CAD application could be implemented. Now, implementing a fully functional 2D CAD is a tremendous task for a single person, and not something that can be completed in just a couple of months when only working on it on and off in the evenings.

Return reduce(lambda p1,p2: p1.Have you ever wondered how a 2D CAD application is designed and implemented? I have, so I decided to sit down and write one. Return Overlappingfaces(facel).makeshape()įile "/Users/keithsloan/Library/Preferences/FreeCAD/Mod/OpenSCAD_Alt_Import/OpenSCAD2Dgeom.py", line 229, in makeshapeįile "/Users/keithsloan/Library/Preferences/FreeCAD/Mod/OpenSCAD_Alt_Import/OpenSCAD2Dgeom.py", line 366, in fusefaces Shape = OpenSCADUtils.process_ObjectsViaOpenSCADShape(fp.Document,fp.Children,\įile "/Users/keithsloan/Library/Preferences/FreeCAD/Mod/OpenSCAD_Alt_Import/OpenSCADUtils.py", line 578, in process_ObjectsViaOpenSCADShapeįile "/Users/keithsloan/Library/Preferences/FreeCAD/Mod/OpenSCAD_Alt_Import/OpenSCADUtils.py", line 521, in process2D_ObjectsViaOpenSCADShapeįile "/Users/keithsloan/Library/Preferences/FreeCAD/Mod/OpenSCAD_Alt_Import/OpenSCAD2Dgeom.py", line 497, in importDXFfaceįile "/Users/keithsloan/Library/Preferences/FreeCAD/Mod/OpenSCAD_Alt_Import/OpenSCAD2Dgeom.py", line 410, in edgestofaces
#Openscad 2d code
9-7a51.htmĪs it is calling OpenSCAD to perform the minkowski and for 2D shapes getting the result back as a DXF, maybe OpenSCAD has changed its DXF output, but anyway I think the code needs to be made more robust in that if it fails to find a layer, it should treat the whole file as a single Layer.Ĭode: Select all 23:24:32 opening /var/folders/cj/z259fmwd41dgzl8mq8nppwd40000gn/T/fc-03964-267235-000004.dxf.Ģ3:24:32 successfully imported /var/folders/cj/z259fmwd41dgzl8mq8nppwd40000gn/T/fc-03964-267235-000004.dxfĢ3:24:32 Traceback (most recent call last):įile "/Users/keithsloan/Library/Preferences/FreeCAD/Mod/OpenSCAD_Alt_Import/OpenSCADFeatures.py", line 504, in execute The DXF file does not contain a LAYER as per. I assume given the lines 493 and 494 it is expecting to find a Layer? As it gets set to an empty list, I think it failed to find a Layer I don't understand what line 491 does but for this file groupObj.Group it ends up set to empty list, so all further processing for edges. The prints in the Report Console seem to indicate the DXF has been imported okay and FreeCAD window displays it correctly.

4.AppImageĬode: Select all 479 def importDXFface(filename,layer=None,doc=None):Ĥ84 doc = doc or FreeCAD.activeDocument()Ĥ85 layers = importDXF.processdxf(doc,filename,False,False) or importDXF.lay ersĤ91 groupobj=Ĥ94 raise ValueError('import of layer %s failed' % layer) I can manually import the DXF generated at /tmp/fc-03390-361277-000012.dxf and it loads ok. : 'NoneType' object has no attribute 'Label' LocateLayer("0",, "Solid")įile "/tmp/.mount_freecagiaOCe/usr/Mod/Draft/importDXF.py", line 349, in locateLayer Layers = importDXF.processdxf(doc,filename,False,False) or importDXF.layersįile "/tmp/.mount_freecagiaOCe/usr/Mod/Draft/importDXF.py", line 2223, in processdxf Return process2D_ObjectsViaOpenSCADShape(children,name,doc)įile "/tmp/.mount_freecagiaOCe/usr/Mod/OpenSCAD/OpenSCADUtils.py", line 547, in process2D_ObjectsViaOpenSCADShapeįace = importDXFface(tmpfilename,None,None)įile "/tmp/.mount_freecagiaOCe/usr/Mod/OpenSCAD/OpenSCAD2Dgeom.py", line 485, in importDXFface Shape = _ObjectsViaOpenSCADShape(fp.Document,fp.Children,\įile "/tmp/.mount_freecagiaOCe/usr/Mod/OpenSCAD/OpenSCADUtils.py", line 604, in process_ObjectsViaOpenSCADShape Please use 'make_layer'.ġ4:20:12 typecheck: '' is not ġ4:20:12 Wrong input: must be a tuple of three floats 0.0 to 1.0.ġ4:20:12 Traceback (most recent call last):įile "/tmp/.mount_freecagiaOCe/usr/Mod/OpenSCAD/OpenSCADFeatures.py", line 503, in execute Code: Select all 14:20:12 ImportCSG Version 0.6aġ4:20:12 WARNING: Token 'DOT' defined, but not usedġ4:20:12 WARNING: Token 'WORD' defined, but not usedġ4:20:12 WARNING: There are 2 unused tokensġ4:20:12 WARNING: Couldn't create 'parsetab'.
