Verify Scene 2

Scripting
2015-02-13
2015-02-15
  • Marco Brenco

    Marco Brenco - 2015-02-13

    I created a new version of the "Verify Scene" script, that in case of a triangle mesh also checks whether two faces of an object are coplanar and overlapping.

    It seems a rare situation but many results of my extrusions are marred by this flaw - I'm going to open a separate issue for that. The flaw is not even detected by the Solid Tool, but makes itself evident in subsequent CSG operations.

    Since the check is much slower now, I've also added the possibility to verify only a selection of objects rather than the whole scene.

     
  • Marco Brenco

    Marco Brenco - 2015-02-13

    Here it is. Comments (and tests) are welcome.

     
  • Luke S

    Luke S - 2015-02-14

    An excellent idea to allow using on only some of the objects. What is your normal run-time, given a reasonably limited mesh?

    Just found a bug, or rather, a case that is not handled:

    • Line 113, the method ParameterValue.getValue() is only applicable to some types of ParameterValue. It is a convenience method that is useful if you are sure of what type of parameter mapping is being used. Other types of parameter have their own versions. (Or return something other than a single value. You already handle the case in which the method returns an array.)
    • Specifically, FaceVertexParameter has getValue(int faceIndex, int vertIndex) and will throw an exception if called as you do in the script.

    Future ideas:

    • Convert to groovy. This should decrease runtime.
    • If runtimes are still long, add a second level to the progress indicator. "Checking for intersecting coplanar faces. x of y possible pairs." and update x every couple of seconds, etc.
     
  • Marco Brenco

    Marco Brenco - 2015-02-14

    Well Luke most of the code is by Peter, I didn't even look at that getValue() method. Just added my additional check, and the Verify Selection stuff. I'm afraid a groovy version will not come from me, I know little about it.
    When I check a mesh with 3000 polygon I have to wait half a minute sometimes :(
    But it does its job. I tested it with a scene with two cubes that I place in different positions, sometimes with touching faces, and I use the join objects script to create an invalid mesh.

     
  • Luke S

    Luke S - 2015-02-14

    You're right. I get the same error with the original script. I had thought that the object I was running it on was just too large for my patience... I'll see if I can cover that case.

     
  • Peter Eastman

    Peter Eastman - 2015-02-15

    I'll see if I can translate it to Groovy for you. That should be much faster. If the Beanshell version takes 30 seconds, the Groovy version should take only 1 or 2 seconds.

    Peter

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks