Hi Itascans,
I would like to create some similar volume meshes with Griddle, could I automatize the process using Python in Rhino?
Thanks!
Hello Carlos!, yes. it is possible!
Thanks Matias.
Where could I find the documentation?
i think you should look into rhino documentation to build python script and directly use the griddle commands into it
Hi Carlos. I agree with Matias, the best way to start using Griddle with Python in Rhino is to go through general Python docs and examples. You can start here:
https://developer.rhino3d.com/api/RhinoScriptSyntax/
You can call any Griddle function from Rhino Python using this syntax:
import rhinoscriptsyntax as rs
rs.Command("*Griddle command goes here*")
where Griddle command would be something like this:
rs.Command("_SelAll _GSurf _Mode=Tri _MinEdgeLength=1 _MaxEdgeLength=10 _RidgeAngle=10 _AdvancedParameters _Optimization=5 _ShapeQuality=0.9 _Enter _Enter")
This essentially simulates what you would type in Rhino’s command prompt (instead of clicking on icons). Note that all the keywords have underscore which may be necessary if you have non-English locale on your machine (to properly translate keywords and not get confused with local settings/keywords). Also note that putting _Enter
at the end is necessary.
I attached below a relatively complex script which automatically generates and meshes a geometry for a tunnel and DFN around it (currently it creates 30 fractures and orients them randomly according to a Gaussian distribution around average dip and strike angles). At the end, the script creates a tetrahedral volume mesh and automatically outputs it for 3DEC. It is currently set to run 2 realizations. To run the script, save an empty Rhino 8 project at the same location as the initial DXF and .py file. The script is rather complex but it has many comments and you can reuse parts of it for other scripts.
DFN_mesh.zip (33.9 KB)