Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix meshes of cart-bar (flip normal direction) #435

Merged
merged 1 commit into from
Jun 5, 2020

Conversation

YoheiKakiuchi
Copy link
Member

Cart-bar will be fixed with this PR.

Meshes of bar is backside. ( dark part in the picture / converted meshes)
gifplastic_cart_org

Meshes of bar was fixed
gifplastic_car_new

original file is fixed with https://github.com/jsk-ros-pkg/euslib/pull/332

@knorth55
Copy link
Contributor

knorth55 commented Jun 3, 2020

@YoheiKakiuchi
PRに関係なく質問なのですが、
euslispのface norlaは物体の内側に向いているのが正しいのでしょうか?
どのようにmeshのnormalを確認していますか?

このissueもみていました。
euslisp/jskeus#454

@YoheiKakiuchi
Copy link
Member Author

法線は外向きが正しいです。
正しいとは、法線の出て行く面が表面(bodyの外側から見える面)になります。

eusだと見かけ上は裏と表に差がない場合が多いですが、meshファイルにしてmeshlabなどで表示すると
裏側は色を塗らなかったりするので、表裏であることがはっきりします。

以下のようにするとfaceのnormalの向きが分かります。

(defun pointcloud-with-normal (bdy)
  (let (pts nms)
    (dolist (f (send bdy :faces))
      (let ((vv (send f :vertices))
            (nm (send f :normal)))
        (push vv pts)
        (push (make-list (length vv) :initial-element nm) nms)
        ))
    (instance pointcloud :init :points (flatten pts) :normals (flatten nms))
    ))

(setq cb (make-cube 100 100 100))
(setq pt (pointcloud-with-normal cb))
(objects (list cb pt))

normal_view

@knorth55
Copy link
Contributor

knorth55 commented Jun 4, 2020

ありがとうございます
法線の方向のついて確認してみようと思います

@k-okada k-okada merged commit 0eae6d3 into euslisp:master Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants