Best Uniform Remesher For Patterning Organic Suraces - Grasshopper2024-03-29T00:30:37Zhttps://www.grasshopper3d.com/forum/topics/best-uniform-remesher-for-patterning-organic-suraces?commentId=2985220%3AComment%3A1835035&feed=yes&xn_auth=noI got it to work and made it…tag:www.grasshopper3d.com,2018-01-02:2985220:Comment:18741772018-01-02T11:43:46.243ZBathsheba Grossmanhttps://www.grasshopper3d.com/profile/BathshebaGrossman
<p>I got it to work and made it use a binary STL for the input to OpenFlipper. Attached.</p>
<p>It looks like they fixed the issue where the -b option didn't work, now you can run it without bringing up the GUI and it's a bit faster. </p>
<p>It's a nice remesher, but for any real use they need to fix the problem that it cannot output a binary STL from a script. I never expected to see an ASCII STL again in this life. I complained on their mailing list.</p>
<p>I would have liked to see what…</p>
<p>I got it to work and made it use a binary STL for the input to OpenFlipper. Attached.</p>
<p>It looks like they fixed the issue where the -b option didn't work, now you can run it without bringing up the GUI and it's a bit faster. </p>
<p>It's a nice remesher, but for any real use they need to fix the problem that it cannot output a binary STL from a script. I never expected to see an ASCII STL again in this life. I complained on their mailing list.</p>
<p>I would have liked to see what you guys did with it. Don't know if ning is corrupt here or what. :-(</p>
<p></p>
<p>Thanks for the pointer. It is fast.</p> This sounds interesting but i…tag:www.grasshopper3d.com,2018-01-01:2985220:Comment:18737962018-01-01T11:19:00.417ZBathsheba Grossmanhttps://www.grasshopper3d.com/profile/BathshebaGrossman
<p>This sounds interesting but it is sad that all the images are gone. </p>
<p>This sounds interesting but it is sad that all the images are gone. </p> This is incredible, Nik! Than…tag:www.grasshopper3d.com,2017-10-18:2985220:Comment:18350352017-10-18T19:27:42.820ZMathias Gmachlhttps://www.grasshopper3d.com/profile/MathiasGmachl
<p>This is incredible, Nik! Thanks so much for finding and implementing it.</p>
<p></p>
<p>This is incredible, Nik! Thanks so much for finding and implementing it.</p>
<p></p> I cleaned up the script(s) in…tag:www.grasshopper3d.com,2017-10-09:2985220:Comment:18281312017-10-09T22:32:14.828ZNik Willmorehttps://www.grasshopper3d.com/profile/NikFromNYC
<p>I cleaned up the script(s) in the original post enclosure to remove unworking directory selection that will fail with spaces, in favor of just hard wiring it to the C: drive and fixed a wrongly named variable. It's a short enough script for normal users, along with Stackoverflow and Google English language searches to debug in the future. Just try isolating the problem in a copy of the script, paring it down to a few lines that still fail the same way, then ask around, since then you'll…</p>
<p>I cleaned up the script(s) in the original post enclosure to remove unworking directory selection that will fail with spaces, in favor of just hard wiring it to the C: drive and fixed a wrongly named variable. It's a short enough script for normal users, along with Stackoverflow and Google English language searches to debug in the future. Just try isolating the problem in a copy of the script, paring it down to a few lines that still fail the same way, then ask around, since then you'll likely only have a basic Python issue to figure out.</p>
<p></p>
<p>import Rhino<br/>import subprocess<br/><br/># TO MAKE THIS WORK, RIGHT CLICK RHINO.EXE AND OPENFLIPPER.EXE TO ACCESS THE PROPERTIES>COMPATIBILITY TAB AND CHECK "RUN THIS PROGRAM AS ADMINISTRATOR."<br/># ALSO MAKE SURE TO EDIT THE OPENFLIPPER CORRECT VERSION NUMBER AND INSTALLATION PATH THAT I HAVE HARD-WIRED TO VERSION 3.1, BELOW.<br/><br/># Write an ASCII format STL file for the input mesh, for OpenFlipper to operate on:<br/>stl_file = open("C:/NIKS_OPENFLIPPER_PARSER_TEMP.stl","w")<br/>stl_file.write("solid OBJECT\n")<br/>Input_Mesh = Mesh # Let's not use the Rhino term Mesh in the script itself.<br/>Input_Mesh.Normals.ComputeNormals() # NITM ("Not In The Manual") but this is needed first.<br/>verts = Input_Mesh.Vertices # Get all vertices of the mesh from Rhino.<br/>for i,face in enumerate (Input_Mesh.Faces): # Rhino gives faces by vertex index number.<br/>stl_file.write(" facet normal %s\n" % str(Input_Mesh.FaceNormals[i]).replace(",", " ")) # Rhino gives normals!<br/>stl_file.write(" outer loop\n")<br/>stl_file.write(" vertex %s\n" % str(verts[face.A]).replace(",", " ")) # Rhino has ABCD properties for face vertex index numbers.<br/>stl_file.write(" vertex %s\n" % str(verts[face.B]).replace(",", " "))<br/>stl_file.write(" vertex %s\n" % str(verts[face.C]).replace(",", " "))<br/>stl_file.write(" endloop\n")<br/>stl_file.write(" endfacet\n")<br/>stl_file.write("endsolid OBJECT\n")<br/>stl_file.close()<br/><br/># Generate an OpenFlipper script on the fly in order to alter settings not accepted on its command line:<br/>openflipper_script = open("C:/NIKS_OPENFLIPPER_PARSER_TEMP.ofs", "w")<br/>openflipper_script.write("core.loadObject(\"C:\\\\NIKS_OPENFLIPPER_PARSER_TEMP.stl\")\n")<br/>openflipper_script.write("id = core.getObjectId(\"NIKS_OPENFLIPPER_PARSER_TEMP.stl\")\n")<br/>openflipper_script.write("remesher.uniformRemeshing(id,%s,%s,%s,true)\n" % (TargetEdgeLength, Iterations, AreaInterations))<br/>openflipper_script.write("core.saveObject(core.getObjectId(\"NIKS_OPENFLIPPER_PARSER_TEMP.stl\"),\"C:\\\\Out.stl\")\n")<br/>openflipper_script.write("core.exitApplication()\n")<br/>openflipper_script.close()<br/><br/># Windows command line execution of OpenFlipper with argument to run our script:<br/>OFS = "C:/NIKS_OPENFLIPPER_PARSER_TEMP.ofs"<br/>subprocess.call(['C:\Program Files\OpenFlipper 3.1\OpenFlipper.exe',OFS]);<br/><br/># Read in the OpenFlipper output STL file back into Grasshopper:<br/>mesh = Rhino.Geometry.Mesh() # Initialize "mesh" variable as a blank mesh object to hold each face.<br/>MESH = Rhino.Geometry.Mesh() # Initialize "MESH" variable as a blank mesh object to accumulate faces.<br/><br/>with open("C:/Out.stl") as f:<br/><br/> for line in f:<br/> if "vertex" in line:<br/> q = line.replace("vertex ", "")<br/> q = q.replace("\n", "")<br/> q = [float(x) for x in q.split()]<br/> mesh.Vertices.Add(q[0],q[1],q[2]) # Fill mesh with three vertex lines in a row.<br/><br/> if "endloop" in line: # File itself tells us we are done with three vertices for one face.<br/> mesh.Faces.AddFace(0,1,2) # Create a single face mesh.<br/> MESH.Append(mesh) # Magically build a real multi-face mesh while removing redundant vertices.<br/> mesh = Rhino.Geometry.Mesh() # Reinitialize empty mesh object for each mesh face.<br/><br/>MESH.Normals.ComputeNormals() # Gives nice mesh and preview but makes the script take longer.</p> There are convoluted ways to…tag:www.grasshopper3d.com,2017-10-09:2985220:Comment:18279412017-10-09T21:21:29.323ZNik Willmorehttps://www.grasshopper3d.com/profile/NikFromNYC
<p>There are convoluted ways to demand administrator status from the Python code but it would make the script rather confusing and long instead of one line per action.</p>
<p>There are convoluted ways to demand administrator status from the Python code but it would make the script rather confusing and long instead of one line per action.</p> Yes, there's two versions, an…tag:www.grasshopper3d.com,2017-10-09:2985220:Comment:18276982017-10-09T19:22:40.640ZNik Willmorehttps://www.grasshopper3d.com/profile/NikFromNYC
<p>Yes, there's two versions, and mine is the beta one with more features, so that's the 3.1, I guess. They call it the "staging" version, though on their web site both normal and staging are listed under 3.1 version.</p>
<p></p>
<p>You can also tell OpenFlipper to not show the splash screen, which is a bit more bewildering than just having the program come up while it's working. I would also like to tell it to start up in hidden line mode so I could briefly see the mesh. By the way, if…</p>
<p>Yes, there's two versions, and mine is the beta one with more features, so that's the 3.1, I guess. They call it the "staging" version, though on their web site both normal and staging are listed under 3.1 version.</p>
<p></p>
<p>You can also tell OpenFlipper to not show the splash screen, which is a bit more bewildering than just having the program come up while it's working. I would also like to tell it to start up in hidden line mode so I could briefly see the mesh. By the way, if OpenFlipper is taking too long, it will lock up Grasshopper until you cont-alt-del quit OpenFlipper.</p> I just could solve my problem…tag:www.grasshopper3d.com,2017-10-09:2985220:Comment:18276972017-10-09T19:12:06.183ZRudihttps://www.grasshopper3d.com/profile/RudiAckermann
<p>I just could solve my problem: OpenFlipper on my computer is in C:\Program Files\OpenFlipper 3.0\OpenFlipper.exe not in OpenFlipper 3.1 as in your script.</p>
<p>Changing the script accordingly and it works fine. Thanks again for your effort!</p>
<p>I just could solve my problem: OpenFlipper on my computer is in C:\Program Files\OpenFlipper 3.0\OpenFlipper.exe not in OpenFlipper 3.1 as in your script.</p>
<p>Changing the script accordingly and it works fine. Thanks again for your effort!</p> This is extremely helpful. Th…tag:www.grasshopper3d.com,2017-10-09:2985220:Comment:18275772017-10-09T18:52:24.979ZTim Mhttps://www.grasshopper3d.com/profile/TimMichiels
<p>This is extremely helpful. Thank you so much for sharing!</p>
<p>I also had to run Rhino and OpenFlipper as administrator on Windows 10.</p>
<p>This is extremely helpful. Thank you so much for sharing!</p>
<p>I also had to run Rhino and OpenFlipper as administrator on Windows 10.</p> Nik, thanks for looking into…tag:www.grasshopper3d.com,2017-10-09:2985220:Comment:18278442017-10-09T18:41:54.908ZRudihttps://www.grasshopper3d.com/profile/RudiAckermann
<p>Nik, thanks for looking into the issue. I'm working with 64 bit Windows 7. All software is on newest release. Even running both Rhino 64 bit version and Open Flipper 64 bit version as administrator I get the same error as mentioned before.</p>
<p>Nik, thanks for looking into the issue. I'm working with 64 bit Windows 7. All software is on newest release. Even running both Rhino 64 bit version and Open Flipper 64 bit version as administrator I get the same error as mentioned before.</p> I've installed the "OpenFlipp…tag:www.grasshopper3d.com,2017-10-09:2985220:Comment:18277622017-10-09T18:32:34.222ZArturo De La Fuentehttps://www.grasshopper3d.com/profile/ArturodelaFuente
<p>I've installed the "OpenFlipper-Free-3.1-64-Bit" Should I install the other one? I mean the <span>OpenFlipper-Staging-3.1-64-Bit.exe installer.</span></p>
<p>I've installed the "OpenFlipper-Free-3.1-64-Bit" Should I install the other one? I mean the <span>OpenFlipper-Staging-3.1-64-Bit.exe installer.</span></p>