• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

normal vector to a face

  • Thread starter Thread starter Gio_S
  • Start date Start date

Gio_S

Guest
even if it is not mandatory ( placing everything to 0), that the stl contains the normal carrier to each face, in my cad parser I have implemented it. the place because I have done enough effort, and it would seem correct, making compute vectors from other programs I never had differences, but you can never say.
So, on one side maybe it can be useful to some crazy, maybe instead someone finds mistakes.
ps. the cad admits faces at 4 vertices, the slate wants 3. apart from that, I have the routine that if it is necessary "spezza" in two the 3dface, as well as other "=zero" area controls. in the following list I already take the only three points a,b,c data for "goods".
Code:
(setq xv (- (*-by ay) (-cz az)) (* (-bz az) (-cy ay) )))
(setq yv (- (*-bz az) (-cx ax)) (* (-bx ax) (-cz az))))
(setq zv (- (*-bx ax) (-cy ay) (*-by ay) (-cx ax) ()))
(setq nodivby0 (+ (* xv xv) (* yv yv) (* zv zv)) )
(if (= nodivby0 0) (setq nodivby0 0.00001))
(setq raddiv (sqrt nodivby0))
(setq xn (/ xv Radiv) )
(setq yn)
(setq zn (/ zv Radiv) )
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
ciao
Back
Top