Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

New Feature: Delaunay Triangulation

Derek_Van_Allen_BDDerek_Van_Allen_BD Member Posts: 71 PRO

This one is gonna be self explanatory. I've seen a few requests for voronoi scripts or other geometric operations which most often run a Delaunay Triangulation of a face as step #1 before doing the fancy footwork of an actually useful function. I was looking for a median curve drawing script some time ago which called for this and I struck out finding anyone that had implemented this in featurescript yet. It takes a face and returns a sketch triangulation of that face, a real special one with useful triangular properties for other functions.

You'll know if you've ever needed something based on this algorithm. Here's my implementation of this algorithm.

image.png

If one of you gets around to going full Voronoi based off of this script before I do please post it here so I can copy off of your homework.

Comments

  • Derek_Van_Allen_BDDerek_Van_Allen_BD Member Posts: 71 PRO

    Status update: I did get voronoi working but that's much less exciting than the other development. I got an 80x performance increase by simply breaking the cardinal rule of featurescript. By shoving the calculation results into an editing logic function I can cut rebuild time immensely at the minor cost of removing the parametric nature of the function. It now builds purely on stale references until prompted to update at which point the lag machine switches on for long enough to build the new geometry and return to snappy operational speeds.

    image.png

    Maybe not exciting for this particular application but if applied to @EvanReese's Surface Drape function or a tight fit packing algorithm for Auto Layout I think I'm gonna start abusing editing logic functions as a cache and throw away my parametric tethers for some features.

  • edited June 10
    This content has been removed.
  • EvanReeseEvanReese Member, Mentor Posts: 2,403 ✭✭✭✭✭

    This is rad! I've researched doing delaunay and voronoi in FS but never got around to it. I have also used the Editing Logic to cache things, though I set it up with a boolean checkbox so you can choose to use it or not. Thanks for sharing!

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • EvanReeseEvanReese Member, Mentor Posts: 2,403 ✭✭✭✭✭

    Any reason to not take sketch faces as input?

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • Derek_Van_Allen_BDDerek_Van_Allen_BD Member Posts: 71 PRO

    None in particular, I can add that in. Probably just overlooked that because I rarely actually use sketches in my workflows.

  • Derek_Van_Allen_BDDerek_Van_Allen_BD Member Posts: 71 PRO

    This was more of an attempt to see how much they'd let me get away with storing values to an editing logic function. My real goal is a random seeded iterative gradient descent solver that you click the button multiple times to get better and better results for arc fitting on splines.

Sign In or Register to comment.