Progress on new mesh tools

joshtargo
joshtargo Member Posts: 695 EDU

Building some mesh tools in this Public Document.

See process below:


Import mesh

image.png

Use MultiPointPlane to least squares fit through points

image.png


use SectionCurves to get raw polyline sections through mesh

image.png

Sketch circles near inside and outside circular features, depending on what you want to fit

image.png

use CircleSearch to fit circles directly to mesh using RANSAC fitting.

image.png

Comments

  • S1mon
    S1mon Member Posts: 4,636 PRO

    I haven't had a chance to try these yet, but very excited to see work on tools like this.

    It would be interesting to have a least squares fit, while maintaining parallelism with a reference. Once you have your scan oriented in the "correct" location, one would assume that many surfaces are theoretically parallel to a reference.

    Alternatively, it would be interesting to select a lot of points on multiple discrete planes and have it group them into planes and then force those to be parallel, and then orient the mesh based on those to a reference.

    Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn

  • joshtargo
    joshtargo Member Posts: 695 EDU

    It should be trivial to modify multipointplane to also allow transform. But picking origin is tricky. Maybe I can do some kind of auto symmetry search from a section or the full cloud.

  • ry_gb
    ry_gb Member, csevp, pcbaevp Posts: 273 PRO
    edited October 15

    I was expecting for you to take a week or two develop some of these tools, but you're moving so fast! If I could donate my API tokens, I would.

    Ramon Yip | glassboard.com

  • joshtargo
    joshtargo Member Posts: 695 EDU

    @ry_gb I don't use the api, just cut and paste from vs code

  • joshtargo
    joshtargo Member Posts: 695 EDU
    edited October 15

    Working on FitCylinder.fs. Basically already working!! Adding more options now.

    Biggest issue: Quickly selecting vertices on the visible mesh surface. Picker sees all vertices and will pick ones at the back of the object, and you can't unpick by clicking, you have to find it in the query box and x-out from there. Gonna try to auto-fit from raycast.

    image.png
  • S1mon
    S1mon Member Posts: 4,636 PRO

    Looking more and more exciting. How will your features handle draft?

    Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn

  • joshtargo
    joshtargo Member Posts: 695 EDU
    edited October 15

    @S1mon. debug cylinder is to locate region for raycast. green points are hits. code does RANSAC fit with or without draft. user can lock axis or axis direction, or allow full auto (slower due to fitting). can reverse direction to search for outside of bosses. going to enable surface/solid choice, and try for extend flats up/down.

    image.png
  • MDesign
    MDesign Member Posts: 1,472 PRO

    Uhmmmm. came looking for refresher on another feature and greeted with new tools to play with my current project. **pulls up a chair** and says, "Sir, what do you need from me?

    I've been using best fit plane for points fs for my RE work, but I like your mpp fs better as I can flip the z direction. And now I can set the X to take advantage of the horizontal/vertical sketch constraints straight away. Bravo, well done. X direction should default to from points for what I do most of the time

  • joshtargo
    joshtargo Member Posts: 695 EDU

    @MDesign i have direction default to selection so user can pick a plane.

  • MDesign
    MDesign Member Posts: 1,472 PRO
    edited October 15

    No problem…Probably makes sense for certain workflows/projects. Most of the time when I bring in scan data there is no plane that makes sense to orient to or I am trying to establish those planes that I can rely on. I suspect the preference for selecting a plane for x direction changes once you get a few planes and features created. I usually use factory planes after a certain point once I'm confident that things are parallel and perpendicular as intended. I usually only have 1 plane maybe 2 that are done via featurescript. Maybe that will change with different projects or tools.

  • Derek_Van_Allen_BD
    Derek_Van_Allen_BD Member Posts: 1,165 PRO

    I have been working on a mesh-to-solids app that does something a little bit more targeted than pure RANSAC fitting. Trained a local model on surface classification so it can guess the correct surface types for patches and label regions of mesh with patches that then get turned into analytical surfaces. Computationally it runs way too many loops to be done effectively in Featurescript, and it requires surface normals of the triangles to get more data to sort out some of the core surface types versus essentially pure point cloud data. It works pretty well on simpler models but handling large amounts of triangles at once is still kind of a nightmare just to visualize and process mentally, or correct issues with wrong guesses.

    Still needs more time in the oven, and my T-spline thing is closer to the finish line.