Skip to content

Commit

Permalink
fix eus2stl, check if the body has glvertices, see jsk-ros-pkg/jsk_mo…
Browse files Browse the repository at this point in the history
  • Loading branch information
k-okada committed Jul 24, 2017
1 parent b782d46 commit f480209
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion irteus/irtstl.l
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,21 @@
(defun eus2stl (fname _faceset &key (scale 0.001))
(send _faceset :worldpos)
(with-open-file (f fname :direction :output)
(let ((faces (send (body-to-faces _faceset) :faces)))
(let ((faces))
(cond ((find-method _faceset :bodies)
(setq faces
(mapcan #'(lambda (x)
;(print (list x (boundp 'gl::glbody) (classp gl::glbody) (derivedp x gl::glbody)))
(cond ((find-method x :glvertices)
(send (body-to-faces (send x :glvertices)) :faces))
((cdr (assoc 'user::glvertices (send x :slots)))
(send (cdr (assoc 'user::glvertices (send x :slots))) :faces))
(t
(send (body-to-faces x) :faces))
))
(send _faceset :bodies))))
(t
(setq faces (send (body-to-faces _faceset) :faces))))
(write-stl-header f (length faces))
(dolist (_face faces)
(write-stl-face f _face :scale scale))))
Expand Down

0 comments on commit f480209

Please sign in to comment.