Hi,
I am rewriting scripts written in Rhino5 to make them compatible in Rhino6. I have encountered a problem with the SplitMeshWithCurve command. After I execute the command, the mesh is deleted and only the curve remains. Here is the script:
Some of my meshes do split, but not all. I couldnât get MeshSplit to work with a curve, but If i extrude it through the mesh then I can use it to split.
If there is any additional info though I would appreciate it, as the extrude method isnât always going to work for me. The bug seems to be related to the mesh rather than the curve. In particular how it was created seems to matter. From the little bit of testing I have done:
Meshes that split properly
Imported mesh from obj file
Create a mesh sphere/cube/cylinder etc
Meshes that disappear
Meshfrompoints
Create a solid sphere/cube/cylinder etc, convert to mesh
Offsetmesh (EDIT: Depends on the input mesh)
Things that donât change behaviour
Reducemesh
Changelayer
Copy/Paste
Meshsplit
Deletemeshfaces
Things that do change behaviour
Export as obj and reinsert (goes from busted to working)
Iâm not sure if there are any clues there as to the cause?
I have reduced the bug to the simplest form I could. One layer has a single mesh face created from a square surface using the âmeshâ command. The second has a single mesh face created directly from the â_3DFaceâ command.
I then projected a circle onto the two meshes. The first layer fails to split, and the mesh disappears, whereas the second splits fine.
Cheers,
Chris
EDIT: Having another look at this file, and the properties of the meshes, I can see that the one that works is a double precision mesh whereas the other is not. Having a look at some of my other files it seems that all the ones that disappear are not double precision. Is there a way to convert them? This would solve all my issues.
Hi Chris - it doesnât deal with the core of the problem but a workaround is to move the mesh âvery farâ from the origin. In your file, moving the objects on the âMeshed Surfaceâ layer from the world origin to 100000000,0,0 converts the mesh to a double precision mesh and then using SplitMeshWithCurve yields the correct result. It is entirely possible (even likely) that you can convert them using code but I wouldnât know about thatâŚ
-wim
Yes moving it far away and then back again does work to convert it to double precision. I can include this in my script as a workaround until the bug is fixed.
Hi Chris - Iâve created an extra bug item for this one - RH-56568 - as it seems to me to be easier to automatically convert meshes to double precision and make the command work in many (?) cases than to solve all possible problems with the SplitMeshWithCurve command.
It doesnât solve the issue with the OPâs file thoughâŚ
-wim
This does also work for the OPs file. If I move his mesh very far away and back again it turns into a double precision mesh and I can split it. The line included in the file wont split it cleanly though, I guess its not perfectly on the mesh after moving it away and back, but any new lines I draw or project onto the mesh split it fine.
This is also the case for RH-53063. The meshes in the attached file there are also not double precision. Moving them far away and back again fixes the problem.