DXF composed of Face3d interface to regular grid #1263
-
Hi ! What I am trying to achieve: I have a dxf composed of around 70k Face3D entities. These represent volumes. I can load it with ezdxf without problem. Now I have a regular grid (sugarbox kind with Parallelepiped grid cells) which is referenced in the same space (basically a numpy array). What I want to achieve is to iterate over the Face3D and compute the intersection with the grid. Basically, I would like to compute for each grid cell the proportion of coverage by these volumes. I know how to do that in 2d using libs like shapely, but what would be the right tool for such a task in 3D ? Preferably through a python interface using a permissive licensed tool (e.g. MIT or others). Thank you in advance for the help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
What you want to implement requires a CAD kernel, and My suggestions: CADQueryhttps://cadquery.readthedocs.io/en/latest/intro.html CadQuery is an intuitive, easy-to-use Python module for building parametric 3D CAD models. Using CadQuery, you can write short, simple scripts that produce high quality CAD models. It is easy to make many different objects using a single script that can be customized. FreeCADhttps://www.freecad.org/index.php FreeCAD is an open-source parametric 3D modeler made primarily to design real-life objects of any size. Parametric modeling allows you to easily modify your design by going back into your model history and changing its parameters. FreeCAD has a Python scriptable API. |
Beta Was this translation helpful? Give feedback.
What you want to implement requires a CAD kernel, and
ezdxf
isn't a CAD kernel.My suggestions:
CADQuery
https://cadquery.readthedocs.io/en/latest/intro.html
CadQuery is an intuitive, easy-to-use Python module for building parametric 3D CAD models. Using CadQuery, you can write short, simple scripts that produce high quality CAD models. It is easy to make many different objects using a single script that can be customized.
FreeCAD
https://www.freecad.org/index.php
FreeCAD is an open-source parametric 3D modeler made primarily to design real-life objects of any size. Parametric modeling allows you to easily modify your design by going back into your model history and changing its parameters.