STL to solid - large filesize

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
Quaoar
Posts: 62
Joined: Thu Jul 27, 2017 11:56 am
Location: Nizhny Novgorod
Contact:

Re: STL to solid - large filesize

Postby Quaoar » Thu Sep 19, 2019 12:19 pm

Tried to cut it with a cube to assure it is solid. Seems fine:
sam03.png
sam03.png (148.97 KiB) Viewed 95 times
FOSS CAD model inspection utility and prototyping framework: http://analysissitus.org
Koemi
Posts: 104
Joined: Thu Dec 28, 2017 11:13 am
Location: The Netherlands

Re: STL to solid - large filesize

Postby Koemi » Thu Sep 19, 2019 1:33 pm

Brilliant, Quaoar. Thanks!

Out of curiousity (maybe for others too): how did you do this? Small description maybe?
User avatar
Quaoar
Posts: 62
Joined: Thu Jul 27, 2017 11:56 am
Location: Nizhny Novgorod
Contact:

Re: STL to solid - large filesize

Postby Quaoar » Thu Sep 19, 2019 7:51 pm

Koemi wrote:
Thu Sep 19, 2019 1:33 pm
Out of curiousity (maybe for others too): how did you do this? Small description maybe?
A part of my PhD research is to develop open-source software for reverse engineering CAD models. I am looking now how to reconstruct freeform (sculptural) geometries from STL meshes. Here is how it generally works:

- Prepare triangulation (decimate, fill gaps). For that, VTK is a good fit.

- Retopologize it with quads. For now, I tried Instant Meshes, but it has severe limitations: the grid it produces is not adaptive (it gives uniform size distribution regardless of surface curvature), and feature lines are not preserved (this has a negative impact on the quality of reconstruction). Retopology consists in constructing a dual quad mesh (the job of Instant Meshes), then projecting the edges and vertices back on the original triangulation.

- The projected edges are approximated with B-curves, then quad cells are fitted with Coons patches converted to NURBS. Here two extensions are possible: refine the surfaces by least-squares + smoothing approximation to better fit the underlying mesh nodes; join Coons surfaces smoothly by making the corresponding B-surfaces compatible along their natural boundaries (knot insertion and poles alignment are done) to achieve G1 continuity.
smoothed-zebra.png
smoothed-zebra.png (123.02 KiB) Viewed 68 times
- Finally, the deviation between the reconstructed curved model and the initial mesh can be checked by sampling the curved part and projecting each sample point to the initial triangulation.

Here is the process (cut to speed up):

Image

The corresponding code will be available in a dedicated software package once I polish a few things (the link is below in my signature).
FOSS CAD model inspection utility and prototyping framework: http://analysissitus.org
User avatar
Kunda1
Posts: 5801
Joined: Thu Jan 05, 2017 9:03 pm

Re: STL to solid - large filesize

Postby Kunda1 » Sun Sep 22, 2019 12:48 pm

Quaoar wrote:
Fri Sep 13, 2019 6:07 pm
Out of curiosity, I laid it out with Coons patches after twice decimating the input mesh with VTK quadric decimation tool. To retopologize the model Instant Meshes is an awesome utility. Still, there is a lack of G1 continuity on edges, and this should somehow be worked out. Also, a couple of gaps is to be filled.
Can you give a step-by-step of how you did this ?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features