Jump to content

Strange behavior with CSG.


oschakravarthi
 Share

Recommended Posts

Hi,

I am getting unexpected results when I work with CSG.

I am trying to do the below stuff with my model which is a flat/apartment.

1. In my model, merge all the meshes which are floors. Get a CSG.

2. foreach other mesh, if it is below 1.6 meters from any floor,

    2.1 find out its position if it is placed on the floor.

    2.2 Subtract this area from the above CSG      

 

Now the CSG will have holes. I use this CSG to create a navigation mesh so that if there is a hole, it means we cannot navigate there.

 

The same stuff is implemented in a sample. It is working fine. https://www.babylonjs-playground.com/#QSS0FZ#6

 

When I try this with real model, I am getting strange results. https://www.babylonjs-playground.com/#QSS0FZ#13

All the holes are kept one side only. The core logic in both the scenarios is exactly same. No idea why it is not coming properly

 

I have been struggling on this for more than 8 days. Can you please help me 

 

Thanks in advance

 

@trevordev, @brianzinn, @Sebavan Please help me.

 

 

 

 

 

working.png

not working.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...