To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 4015
4014  |  4016
Subject: 
Re: stl2dat conversion tool beta2
Newsgroups: 
lugnet.cad.dev
Date: 
Fri, 11 Feb 2000 20:29:56 GMT
Reply-To: 
RUI.MARTINS@nomorespamLINK.PT
Viewed: 
1187 times
  
Does STL allow only for triangles ? no Quads ? no N sided Polygons ?

No ONLY Triangles. Look for STL format description
http://www.eng.clemson.edu/~wfeng/stl_fmt.htm
http://www.sdsc.edu/tmf/Stl-specs/stl.html
http://www.ennex.com/fabbers/StL.sht

Thanks for this info, I couldn't find it on WOTSIT's site.

Buy the way, do you correctly generate these lines (expecially the
optional ones) ?

<SNIP>

The program check the angle between two adjacent facets
if abs(angle ) < 1e-5
No Edge
if abs(angle) < 45°
Optional Edge
else
Normal Edge

Both those constant should be configurable, eventually within
predefined ranges.

Maybe You should allow the use of the abs() function to be optional,
because if the face normal are correctly calculated (the faces are well
defined, CCW or CW) you can check the correct value, and NOT the absolute
value.
I think there are some situations in which this would create unwanted
optional lines.

Example suppose a 'kind of cylinder' with this form
---------
\      /
  \    /
   |  |
  /    \
/      \
--------

You should correctly generate vertical (concentric with the cylinder
center) optional lines, but you should NOT generate horizontal optional
lines, which I think your current algo does.

The vertical eventually will define the silhuete, but the horizontals
never will.

A value between 45° and 22.5° should be ok.

How do you measure the angle ?
case 1:
_  _  _______face
   a /
    /
   /face
  /

case 2:
_  _  _______ face
     /a
    /
   /face
  /

However, the program only check strictly
adjacent facets. I have to improve it so it check also
partial adjacent facets.

I don't know exactly what you mean by partial adjacent faces, but if
what you mean is something like this:

<SNIP> ...
Yes, I meant that. Looking the STL format and your comment this
appears to be a bug in my program. I will have a look.

1-----2
|     |
3-----4-----5
|   /   \   |
| /       \ |
6-----------7

A correct case

It's easy do make this work ok, you just have to make a match between one
triangle edge with its neighbor triangle edge, if the edge is the same

Quad = (1 3 4 2)
Try1 = (3 6 4)
Try2 = (6 7 4)
Try3 = (4 7 5)

Try1 and Quad share edge 3-4 (or 4-3, its the same)
Try1 and Try2 share edge 6-4
Try2 and Try3 share edge 4-7

If an Edge belongs to a sigle triangle then it's a
  NORMAL LINE
Else /* Connects two triangles */
  calc angle between the two triangles
  if (angle near 0 ) /* they are coplanar */
    NO LINE
  elsif (angle optional test)
    OPTIONAL LINE
  else
    NORMAL LINE


About new Ideias
You could make also an option to recreat the quads which once whore
quads, you would have to check for this, and  if possible, create quads.

Rui Martins



Message has 2 Replies:
  Re: stl2dat conversion tool beta2
 
(...) Then he wrote: (...) Or more simply (in LDraw-world), this: 1--2 | | | 4--5 | / | |/ | 6-----7 Leading to: 1--2 |\ | | 4--5 | / \ | |/ \| 6-----7 That was fun! Steve (25 years ago, 11-Feb-00, to lugnet.cad.dev)
  Re: stl2dat conversion tool beta2
 
(...) The normal is explicitely given in STL files. (...) Yes. I have planed to optimize this point. I think it is the same case for internal cylinders. The angle must be convex and not concav. However, it is not done yet. (...) I use case 1: _ _ (...) (25 years ago, 14-Feb-00, to lugnet.cad.dev)

Message is in Reply To:
  Re: stl2dat conversion tool beta2
 
(...) No ONLY Triangles. Look for STL format description (URL) >Buy the way, do you correctly generate these lines (expecially the (...) <SNIP> (...) The program check the angle between two adjacent facets if abs(angle ) < 1e-5 No Edge if abs(angle) (...) (25 years ago, 11-Feb-00, to lugnet.cad.dev)

14 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR