CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

STL from a 3D scan to parametric surface

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 2 Post By lvl99
  • 1 Post By Aeronautics El. K.
  • 1 Post By sbaffini

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 24, 2023, 10:22
Default STL from a 3D scan to parametric surface
  #1
New Member
 
Luis VL
Join Date: Jul 2022
Location: Toulouse
Posts: 18
Rep Power: 4
lvl99 is on a distinguished road
Hello,

I've been trying to solve this problem for a number of days already and I don't quite find an option that fits. I have a .stl file that comes from the 3D scan of a real object, so it is defined by a large number of triangles. What I want to do is something similar to the Fusion360 option {convert mesh (prismatic)}, I'm attaching a screenshot of a .stl sphere and another screenshot from the object that this option creates.

The problem is that when I apply this algorithm to the stl file that I have it doesn't work since the surface is too complex. I've been searching for an option to solve it and I've found that there exist some softwares that do this (Rhino7, CySlice, etc) but I'm searching an open-source option first.

I've found the Gmsh software that looks promising but I still have to look into it, if someone knows if it works for this or if it doesn't I would appreciate your knowledge.

The last option I'm looking into is writing my own python code to do this, I've found the article: 'Automatic and Interactive Mesh to T-Spline Conversion. Wan Chiu Li, Nicolas Ray, Bruno Lévy' which describes an automatic algorithm to create the surface I want, but I know that this will take me some time to implement so I would like to know if you guys know of some code/software that could help me solve my problem.

tldr: I have a .stl with a lot of faces and I would like to convert it into a surface with the minimun possible faces.

Edit: I'm attaching a screenshot from the Wikipedia page for .stl, basically it's easy to go from Cad to .stl but what I'm searching for is a way to go from .stl to Cad (I suppose I will lose information in the process)

Thank you very much!
lvl99
Attached Images
File Type: png fusion.PNG (36.7 KB, 21 views)
File Type: png InitialSphere.PNG (88.5 KB, 21 views)
File Type: png stl.PNG (71.3 KB, 17 views)

Last edited by lvl99; March 24, 2023 at 12:26.
lvl99 is offline   Reply With Quote

Old   March 24, 2023, 11:35
Default
  #2
Senior Member
 
Joern Beilke
Join Date: Mar 2009
Location: Dresden
Posts: 533
Rep Power: 20
JBeilke is on a distinguished road
In StarCCM+ you would do a "Surface Remeshing" or maybe a "Surface Wrapping" before the remeshing.
I don't know about an OpenSource alternative.
JBeilke is offline   Reply With Quote

Old   March 24, 2023, 11:58
Default
  #3
New Member
 
Luis VL
Join Date: Jul 2022
Location: Toulouse
Posts: 18
Rep Power: 4
lvl99 is on a distinguished road
Quote:
Originally Posted by JBeilke View Post
In StarCCM+ you would do a "Surface Remeshing" or maybe a "Surface Wrapping" before the remeshing.
I don't know about an OpenSource alternative.
Hi JBeilke,

Thank you for your answer! I just checked this video and I think that's not exactly what I want (I'm joining a screenshot of his final result)

He basically created a very refined mesh for that object, I already have a very refined mesh from the 3D scan (that's actually the problem) what I want to do is to describe this meshed geometry as a parametric geometry, I'm attaching two example meshes so it is easier to understand.

As you can see in the screenshots, what I have is a very dense triangular mesh, and what I want is the same geometry described in a parametric form (in this case the surface is described with Bezier patches)

Btw, the example meshes are not mine, I took the screenshots from 'High Quality Surface Remeshing Using Harmonic Maps: J-F Remacle, C. Geuzaine, G. Compere and E. Marchandise' but they are useful to understand the idea.

Thank you again,
lvl99
Attached Images
File Type: jpg starmotorbike.jpg (82.9 KB, 24 views)
File Type: png whatIhave.PNG (92.4 KB, 29 views)
File Type: png whatIwant.PNG (73.1 KB, 25 views)
lvl99 is offline   Reply With Quote

Old   March 24, 2023, 12:38
Default
  #4
Senior Member
 
Joern Beilke
Join Date: Mar 2009
Location: Dresden
Posts: 533
Rep Power: 20
JBeilke is on a distinguished road
Both remeshing and mapping can also create coarser meshes.

Creating a CAD model from a triangulated surface is far from easy. Usually you do a completely new cad-surface-model based on splines, which you place on your triangles.

Some cad programs come with more sophisticated tools line ReShaper in ThinkDesign, that try to create analytical surfaces based on the triangles. But it is still a bit like slave work, regardless of the tool you use.Maybe Rhino provides what you need at a reasonable price.
JBeilke is offline   Reply With Quote

Old   March 24, 2023, 16:02
Default
  #5
Senior Member
 
Join Date: Oct 2011
Posts: 242
Rep Power: 17
naffrancois is on a distinguished road
Hello,

Have you tried FreeCAD ? It is open-source.
naffrancois is offline   Reply With Quote

Old   March 25, 2023, 05:47
Default
  #6
Member
 
Join Date: Nov 2019
Posts: 96
Rep Power: 6
FliegenderZirkus is on a distinguished road
I got decent results converting a CT scan into a solid STEP model using Spaceclaim once. Some preprocessing of the triangulation is needed to make it smoother and/or reduce the triangle count before attempting the conversion. The surface wrapping mentioned in one of the posts above is a good method that can do both. Note that Spaceclaim comes in various versions depending on which software it ships with and not all will have the modules needed for this (was it called Additive manufacturing toolbox?). I imagine other software tools will have such functionality, but generally don't expect wonders. My model was reasonably simple and it still took a few days of manual preprocessing to get good results.
FliegenderZirkus is offline   Reply With Quote

Old   March 25, 2023, 13:41
Default
  #7
Senior Member
 
Lefteris
Join Date: Oct 2011
Location: UK
Posts: 341
Rep Power: 16
Aeronautics El. K. is on a distinguished road
Interesting topic. It made me do a quick research so thanks for that.

Quick question, what is the origin of your stl file? I mean, if someone created the stl for you, can't you go back and ask them to give you a stp or igs file of it instead of the stl?
__________________
Lefteris

Aeronautics El. K. is offline   Reply With Quote

Old   March 27, 2023, 05:04
Default
  #8
New Member
 
Luis VL
Join Date: Jul 2022
Location: Toulouse
Posts: 18
Rep Power: 4
lvl99 is on a distinguished road
Quote:
Originally Posted by naffrancois View Post
Hello,

Have you tried FreeCAD ? It is open-source.
Hello,

I didn't try it yet but what I found with a quick search is that I could do it with FreeCAD but it would be a manual process, and since I have more than one geometry to convert and they are very complex geometries I think this may not be the best option, either way I'll keep in mind this possibility.

Quote:
Originally Posted by FliegenderZirkus View Post
I got decent results converting a CT scan into a solid STEP model using Spaceclaim once. Some preprocessing of the triangulation is needed to make it smoother and/or reduce the triangle count before attempting the conversion. The surface wrapping mentioned in one of the posts above is a good method that can do both. Note that Spaceclaim comes in various versions depending on which software it ships with and not all will have the modules needed for this (was it called Additive manufacturing toolbox?). I imagine other software tools will have such functionality, but generally don't expect wonders. My model was reasonably simple and it still took a few days of manual preprocessing to get good results.
Hi,

I just checked a bit on the internet and I think it could be usefull but I will try to find a free option first.

Quote:
Originally Posted by Aeronautics El. K. View Post
Interesting topic. It made me do a quick research so thanks for that.

Quick question, what is the origin of your stl file? I mean, if someone created the stl for you, can't you go back and ask them to give you a stp or igs file of it instead of the stl?
Hi,

I'm working as an intern for a company and they asked me to do this geometry conversion, I don't exactly know how these geometries were scanned. I could ask about it but I know they've been having this problem for some time so I don't think they can obtain the stp file directly from the scan since I assume they would have done that already.

---

Thank you all for your answers, right now my plan is to check the C++ library CGAL, especially the tutorials Planar Parameterization of Triangulated Surface Meshes and Triangulated Surface Mesh Segmentation, I'll make an update if I'm finally able to do it.

Thanks again,
lvl99
lvl99 is offline   Reply With Quote

Old   March 29, 2023, 07:35
Default
  #9
Senior Member
 
Joern Beilke
Join Date: Mar 2009
Location: Dresden
Posts: 533
Rep Power: 20
JBeilke is on a distinguished road
This looks very much like what you are looking for:


https://www.verisurf.com/solution-su...e-engineering/
https://www.youtube.com/watch?v=gw9AaDWs0m0
JBeilke is offline   Reply With Quote

Old   March 31, 2023, 10:54
Default
  #10
New Member
 
Luis VL
Join Date: Jul 2022
Location: Toulouse
Posts: 18
Rep Power: 4
lvl99 is on a distinguished road
Quote:
Originally Posted by JBeilke View Post
Hi,

Thank you for your answer, I didn't know this company. They do exactly what I need to do but sadly I'm searching for a free option, I've been checking the CGAL library as I said in my last post and so far it seems promising, although I didn't yet manage to obtain what I want. Either way I'll make a post when I manage to solve it.

Kind regards!
lvl99

Last edited by lvl99; April 21, 2023 at 05:34.
lvl99 is offline   Reply With Quote

Old   April 21, 2023, 05:26
Default
  #11
New Member
 
Luis VL
Join Date: Jul 2022
Location: Toulouse
Posts: 18
Rep Power: 4
lvl99 is on a distinguished road
Little update: While I wasn't able to do it with CGAL I still find it a very useful tool, either way I found the following Github project Which seems to do exactly what I want to do, I already run the example.cpp file inside of the project with a test-mesh that I have and it worked (I'm joining the screenshots here). The only problem is that the code creates the B-Spline but then it exports a triangular mesh of this B-Spline as a .OBJ, and what I want is the B-Spline itself.

Now what I'm trying to do is to export the created B-Spline as a geometry object, say .STEP or .IGES instead of remeshing it and exporting it as a triangulated mesh .OBJ. For this I'm trying to use this other project with the idea to export it as a .IGES file, since my knowledge of c++ is almost 0 it's taking me some time to link these two libraries together and to be able to use functions from one into the other but I hope I'll be able to do it, if I finally do it I'll make another update to this thread.
Attached Images
File Type: png Initial_Nefertiti.PNG (145.2 KB, 24 views)
File Type: jpg AfterCode_Nefertiti.jpg (23.1 KB, 23 views)
lvl99 is offline   Reply With Quote

Old   April 21, 2023, 06:00
Default
  #12
Senior Member
 
Lefteris
Join Date: Oct 2011
Location: UK
Posts: 341
Rep Power: 16
Aeronautics El. K. is on a distinguished road
Thanks for sharing the knowledge. That's quite useful!
lvl99 likes this.
__________________
Lefteris

Aeronautics El. K. is offline   Reply With Quote

Old   May 30, 2023, 07:04
Default
  #13
New Member
 
Luis VL
Join Date: Jul 2022
Location: Toulouse
Posts: 18
Rep Power: 4
lvl99 is on a distinguished road
Final update!: I finally did it, instead of using the project I talked about in my last post I used Open CASCADE, I had to link both projects using the CMakeLists.txt and then I adapted a little bit the values created by the project Scattered Points so they could be used in the Open CASCADE's function "Geom_BSplineSurface". I'm attaching here some screenshots of the output.

Thank you all and I hope this thread may help someone in the future,
Luis.
Attached Images
File Type: png tigerstl.PNG (165.8 KB, 19 views)
File Type: png tigerstep.PNG (120.8 KB, 16 views)
lvl99 is offline   Reply With Quote

Old   August 21, 2023, 04:07
Default STL from a 3D scan to parametric surface
  #14
New Member
 
No
Join Date: Aug 2023
Posts: 2
Rep Power: 0
Mumtaz1 is an unknown quantity at this point
Converting an STL file from a 3D scan into a parametric surface involves several steps and might require specific software tools. Here's a general process that you can follow:

1. **Choose Software Tools**:
- You'll need software that supports both mesh manipulation and parametric surface creation. Software like Rhino, Blender, and Autodesk Fusion 360 are commonly used for such tasks.

2. **Import STL File**:
- Open your chosen software and import the STL file obtained from the 3D baby scan near me. This will create a mesh representation of the scanned object.

3. **Mesh Cleanup (Optional)**:
- If the mesh has imperfections, holes, or excess triangles, you might need to perform mesh cleanup operations using tools available in your software. This step is important to ensure that the resulting parametric surface is accurate and clean.

4. **Surface Reconstruction**:
- Use the software's tools to perform surface reconstruction from the mesh. This involves converting the mesh into a parametric surface representation.
- Some software might have built-in tools for this purpose, while others might require you to use third-party plugins or extensions.

5. **Parametric Surface Creation**:
- Once you have the basic surface, you might need to refine and adjust it to match the original scanned object. This can involve:
- Adjusting control points or parameters to shape the surface as needed.
- Extruding, lofting, or sweeping curves along the surface to add details.
- Creating additional surfaces and joining or blending them to create a complete model.

6. **Detailing and Refinement**:
- Continue refining the parametric surface to match the scanned object's details and features. This might involve adding fine details, fillets, and other design elements.

7. **Validation and Comparison**:
- Compare the parametric surface model with the original scan data to ensure accuracy. Some software tools offer comparison features that allow you to overlay the scan data with the parametric model.

8. **Export Parametric Model**:
- Once you're satisfied with the parametric surface model, export it in a suitable format. Formats like IGES, STEP, or native formats of your software can be used to save the parametric model.

Remember that this process can be complex and might require a deep understanding of both mesh editing and parametric surface modeling. Depending on the complexity of the scanned object and your familiarity with the software tools, you might encounter challenges along the way.

There might be specialized software tools designed specifically for converting 3D scan data into parametric surfaces. Before starting the process, it's a good idea to explore tutorials and resources related to your chosen software to ensure you're using the most effective methods for your specific needs.
Mumtaz1 is offline   Reply With Quote

Old   August 22, 2023, 14:16
Default
  #15
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,192
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by Mumtaz1 View Post
Converting an STL file from a 3D scan into a parametric surface involves several steps and might require specific software tools. Here's a general process that you can follow:

1. **Choose Software Tools**:
- You'll need software that supports both mesh manipulation and parametric surface creation. Software like Rhino, Blender, and Autodesk Fusion 360 are commonly used for such tasks.

2. **Import STL File**:
- Open your chosen software and import the STL file obtained from the 3D baby scan near me. This will create a mesh representation of the scanned object.

3. **Mesh Cleanup (Optional)**:
- If the mesh has imperfections, holes, or excess triangles, you might need to perform mesh cleanup operations using tools available in your software. This step is important to ensure that the resulting parametric surface is accurate and clean.

4. **Surface Reconstruction**:
- Use the software's tools to perform surface reconstruction from the mesh. This involves converting the mesh into a parametric surface representation.
- Some software might have built-in tools for this purpose, while others might require you to use third-party plugins or extensions.

5. **Parametric Surface Creation**:
- Once you have the basic surface, you might need to refine and adjust it to match the original scanned object. This can involve:
- Adjusting control points or parameters to shape the surface as needed.
- Extruding, lofting, or sweeping curves along the surface to add details.
- Creating additional surfaces and joining or blending them to create a complete model.

6. **Detailing and Refinement**:
- Continue refining the parametric surface to match the scanned object's details and features. This might involve adding fine details, fillets, and other design elements.

7. **Validation and Comparison**:
- Compare the parametric surface model with the original scan data to ensure accuracy. Some software tools offer comparison features that allow you to overlay the scan data with the parametric model.

8. **Export Parametric Model**:
- Once you're satisfied with the parametric surface model, export it in a suitable format. Formats like IGES, STEP, or native formats of your software can be used to save the parametric model.

Remember that this process can be complex and might require a deep understanding of both mesh editing and parametric surface modeling. Depending on the complexity of the scanned object and your familiarity with the software tools, you might encounter challenges along the way.

There might be specialized software tools designed specifically for converting 3D scan data into parametric surfaces. Before starting the process, it's a good idea to explore tutorials and resources related to your chosen software to ensure you're using the most effective methods for your specific needs.
OK ChatGPT
sbaffini is offline   Reply With Quote

Old   August 22, 2023, 14:30
Default
  #16
Senior Member
 
Joern Beilke
Join Date: Mar 2009
Location: Dresden
Posts: 533
Rep Power: 20
JBeilke is on a distinguished road
Yeah, but point 7 is fairly important for everone of us. Never blindly trust a CAD geometry. It is often better to scan the real geometry and compare it with the CAD.

Otherwise you might wonder, why your simulation results do not match the experiments :-)
JBeilke is offline   Reply With Quote

Old   August 22, 2023, 14:45
Default
  #17
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,192
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by JBeilke View Post
Yeah, but point 7 is fairly important for everone of us. Never blindly trust a CAD geometry. It is often better to scan the real geometry and compare it with the CAD.

Otherwise you might wonder, why your simulation results do not match the experiments :-)
Yes, just like any other process that needs quality control, or anything an engineer does, to be honest.

Actually, all the points are correct, I think. Still, this quite isn't an answer, like... at all. Is it? There is incredible effort in formatting and completeness, but no actual concrete answer and no context with respect to the other answers. Also, this is the first user message. This is 100% not human.

I am also pretty confident it is chatgtp, as it has a very specific and condescending tone and likes making lists.
lvl99 likes this.
sbaffini is offline   Reply With Quote

Reply

Tags
3d scan, gmsh, meshtosurface, splines, stl


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CFD-Post User Surface STL Import Shifted? denbjornen FLUENT 0 November 16, 2017 18:49
[OpenFOAM] How to slice internalMesh with stl file, or how to elevate ground surface [paraView] clktp ParaView 2 February 24, 2016 08:52
[Gmsh] Problem with Gmsh nishant_hull OpenFOAM Meshing & Mesh Conversion 23 August 5, 2015 03:09
[ICEM] ICEM CFD: STL surface mesh to volumetric mesh a.sarami ANSYS Meshing & Geometry 0 August 20, 2013 11:32
Immersed mesh - STL surface intersection tool arvind3008 Main CFD Forum 0 October 17, 2012 06:51


All times are GMT -4. The time now is 01:32.