Powerino73 / heekscad

Automatically exported from code.google.com/p/heekscad
Other
0 stars 0 forks source link

Support for selecting and operating on STL faces and edges. #335

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I don't know the technical details behind this one but I'd like to be able to 
import an STL file I've created with OpenSCAD, create a sketch from one or more 
faces and then create CNC paths with the pocket tool.

What needs to be done to make this happen?  I imaging some sort of 
decomposition of the STL object into faces and edges is necessary.  Maybe I can 
help.

Original issue reported on code.google.com by jcoffl...@gmail.com on 24 Mar 2011 at 9:17

GoogleCodeExporter commented 8 years ago
The STL file format does not store any connectivity whatsoever between 
triangles. If in your CAD model one "face" is a rounded/shaped surface then it 
will be represented as an unordered "triangle soup" of say 10 000 triangles. 
From the STL file it is impossible to say which triangles belong to what face 
in the original CAD model.

You could either export separate STL files for each face/part in your CAD 
model, or another export/import format should be used (IGES? STEP?)

Original comment by anders.e...@gmail.com on 24 Mar 2011 at 10:15

GoogleCodeExporter commented 8 years ago
Couldn't the triangles be grouped into faces?  If a set of triangles are in a 
plane and share at least one edge with one other triangle in the group then 
they are a face right?  Or rather you could go through all the triangles and 
start combining ones that shared edges into polygons until no more triangles 
with shared edges were left.

How are faces represented in HeeksCAD?  Are they just polygons?

I converted my STL to IGES with BRL-CAD but when I imported it I got a bunch of 
triangles rather than polygons.  I was able to select all the triangles (about 
30) in the plane I was interested in but couldn't figure out how to convert 
this into a face.  I was able to make a group but that was as far as I got.

Original comment by jcoffl...@gmail.com on 24 Mar 2011 at 10:28

GoogleCodeExporter commented 8 years ago
Of course the algorithm I suggested above obviously wouldn't solve the problem 
for curved faces.

Original comment by jcoffl...@gmail.com on 24 Mar 2011 at 10:31

GoogleCodeExporter commented 8 years ago
If you look in HeeksCAD/src/StlSolid.cpp, you will see that the triangles are 
stored as a list of CStlTri objects. They are only used for displaying, at the 
moment.
Maybe you can think of an algorithm that makes sketches from STL objects?

Original comment by danhe...@gmail.com on 24 Mar 2011 at 11:32

GoogleCodeExporter commented 8 years ago
I'm not sure I have the answer but I'll think about it a bit.  Can you answer a 
few basic questions I have?

Some of the concepts are unfamiliar to me.  Is a sketch anything more than a 
collection of lines?  Does it have to be closed?  Can it ever be a solid?

I suppose the solids are all composed of geometry primitives combined via 
boolean operations.

How are solids and sketches related?

Finally, any tips on how to quickly add a menu item for a particular type.  I'd 
like to add a item for StlSolid, 'Convert to Sketch'.

Original comment by jcoffl...@gmail.com on 24 Mar 2011 at 9:26

GoogleCodeExporter commented 8 years ago
Was this ever fixed?  I see tutorials that seem to imply this is possible 
now....

Original comment by KinkyMun...@gmail.com on 24 Jul 2014 at 8:02