I have created the following script that works well! The mcneely github py files are very informative. This is also my first python project ever too, as well as my first Rhino project ever. I am using Atom on Mac with Rhino Version 5.0 WIP 5A761w. I have added checks for nested layers, empty layers, invisible layers, etc. What I would like to do now is before calling the final enter, is to set the Polygon Density of the final mesh process. I don’t understand how this works.
I set the density very low and yet my obj files are the same size. Rs.Command('-Export '+filePath+name+extension+' Enter PolygonDensity=1 Enter') How does this option work and is there an alternative method for reducing and perhaps also smoothing the mesh? Hi radio412, instead of passing this to your rs.Command string. Enter PolygonDensity=1 you can use this. Enter DetailedOptions AdvancedOptions followed by these possible options and values: Angle=0 AspectRatio=0 Distance=0 Density=0.5 Grid=0 MaxEdgeLength=0 MinEdgeLength=0.0001 The best way to figure them out is to start -Export command manually, click on “Browse” in the commandline, enter a filename and look what is available in the commandline.
It is pretty much everything which is available in the meshing dialog. Once DetailedOptions is passed to the commandline, you have the possibility to set up these settings too: JaggedSeams=No PackTextures=Yes Refine=No SimplePlane=No best thing is you make the ones required as variables in your saveObjectsToFile function. Not all need to be passed. Hi Clement Thank you so much for the reply. I think I am starting to understand. My first question is, I see you’re putting an underscore, and it was recommended I put an underscore before my export and Enter commands, but it doesn’t seem required for PolygonDensity. I validate this by seeing the value set in python reflected in the dialog in the interface: rs.Command('-Export '+filePath+name+extension+' Enter PolygonDensity=1 ') Is the underscore a best practice?
My seconds question is, I tried to follow your instructions to investigate the possible commands. It may be because I am on a Mac but I could not complete the steps. I type -Export in the command line.
![Cgtalk .obj Cgtalk .obj](https://1.bp.blogspot.com/_s-p_50MVQAw/SJfEKutHHDI/AAAAAAAAAuM/S778izZyKaE/s1600-/final_Tposes_screenGrab_arms_down_001.jpg)
I am presented with a couple options and a browse button. If I click the browse button, the command line goes away and Rhino presents a save dialog window. I can then save the obj file by hand in the usual way. I can see all the options obj export has available here, but they are not in the same wording.
For example it took trial and error to know that “Polygon Density” correlated to “PolygonDensity” as a command. Also, I like the idea of adding the setting as input parameters to the saveObjectsToFile function. I was hoping to use point cloud counts to determine thresholds when a mesh ought to have PolygonDensity manipulated at all. Forgive my newness to 3d do points make up polygons and thus lowering the polygon count reduces the number of points and thus the file size?
Radio412: Is the underscore a best practice? The (underscore) is just to make shure that the commands can be used in different languages of Rhino, if you would not use it, your script will work in english language version only. The - (hyphen) sign before -Export is to prevent the dialog to pop up, so you can enter everything via the commandline. About your other quesitons: If you only have PolygonDensity in your commandline and DetailedOptions is missing, then i guess this is not yet hooked up in the mac version. I can not verify this from my windows PC but i hope or can chime in to clarify.
Cgtalk .objs For Mac Os X
Radio412: do points make up polygons and thus lowering the polygon count reduces the number of points and thus the file size? Yes, if you have a NURBS surface or polysurface and want to export it as OBJ file, it has to be approximated which means it gets meshed into polygons. These polygons are just faces (quads or triangles) using points. The density sets how far the resulting mesh is allowed to deviate from the originating NURBS object.
Cgtalk .objs For Mac Os
![Mac Mac](https://i.ytimg.com/vi/5RgN-5-gM-M/maxresdefault.jpg)
The smaller the density, the smaller the file size will be. If you select eg.
A NURBS sphere and run the Mesh command in Rhino, you can see various options available in the dialog to control the final density of the mesh. The same options are available in the commandline when you export as OBJ file. At least this is how it works on windows.