jsk-ros-pkg / jsk_model_tools

JSK model utilities
https://github.com/jsk-ros-pkg/jsk_model_tools
BSD 3-Clause "New" or "Revised" License
6 stars 29 forks source link

[eus_assimp] add use-coordinate option to append-vertices in order to… #210

Closed eisoku9618 closed 7 years ago

eisoku9618 commented 7 years ago

… express all the vertices respect to world frame

This option is suggested in https://github.com/jsk-ros-pkg/jsk_model_tools/pull/208#issuecomment-316589508

(progn                                                                                                                                                                                                              
  (load "package://pr2eus/pr2.l")                                                                                                                                                                                   
  (load "package://eus_assimp/euslisp/eus-assimp.l")                                                                                                                                                                
  (pr2)                                                                                                                                                                                                             
  (let (glv-lst)                                                                                                                                                                                                    
    (dolist (bd (send *pr2* :bodies))                                                                                                                                                                               
      (let (glv)                                                                                                                                                                                                    
        (cond                                                                                                                                                                                                       
         ((and (boundp 'gl::glbody) (classp gl::glbody) (derivedp bd gl::glbody))                                                                                                                                   
          (setq glv (send bd :glvertices))                                                                                                                                                                          
          )                                                                                                                                                                                                         
         (t                                                                                                                                                                                                         
          (setq glv (cdr (assoc 'glvertices (send bd :slots))))                                                                                                                                                     
          )                                                                                                                                                                                                         
         )                                                                                                                                                                                                          
        (when glv                                                                                                                                                                                                   
          (push glv glv-lst))                                                                                                                                                                                       
        ))                                                                                                                                                                                                          
    (apply #'save-mesh-file "/tmp/pr2.stl" (append-glvertices glv-lst :use-coordinate t) nil)                                                                                                                       
    )                                                                                                                                                                                                               
  )