Jump to content

How to join two walls as one?


tham_kathy
 Share

Recommended Posts

You can remove with CSG using subtract().  If you add overlapping areas they will be merged:
https://www.babylonjs.com/demos/csg/
It looks like you could subtract the 2 parts separately to have each room as it's own mesh and then merge overlapping. Finding area of intersection I will leave up to you, unless you want to create a playground, but I would imagine the wall depth is known, so you can work from that by repositioning the second room before merging.  When I started I spent more time in CSG than 3d modeling, but you should consider also fixing/splitting the 3D model into submeshes!

Link to comment
Share on other sites

This is what I get when I substract 2 rooms. 

333.JPG

Or is there a way to hide the lines that separate two rooms?
 

666.JPG

Or is it possible to merge those two meshes from 0.5cm without changing their original positions? Then there will be only one wall in between two rooms. 
I'm very new to this 3D stuff  so plz help me to find a solution

 

Link to comment
Share on other sites

1 hour ago, tham_kathy said:

Or is it possible to merge those two meshes from 0.5cm without changing their original positions?

I don't know a way to merge meshes without updating positions.

If you can make a playground then I can possibly provide a solution - you haven't provided any code or model, so it's hard for me to imagine what you have tried or to propose a solution.  Maybe somebody else can help without a 3D model or code though?

Link to comment
Share on other sites

On 9/10/2018 at 10:29 AM, brianzinn said:

I don't know a way to merge meshes without updating positions.

If you can make a playground then I can possibly provide a solution - you haven't provided any code or model, so it's hard for me to imagine what you have tried or to propose a solution.  Maybe somebody else can help without a 3D model or code though?

This is the html file of my code.

 

Link to comment
Share on other sites

@JohnK Actually what I'm doing is creating houses at run time by reading the given floor plan. I get an array of coordinates by reading the floor plan and I'm passing the array values to the buildFromPlan method.  I don't find any method which I can used to automate this process for the number of rooms.  If I use your suggestion, I have no idea how give values for the positions. Anyway, thanks a lot.!

Link to comment
Share on other sites

Here we go, have re-written the buildFromPlan function and now you can use an interior: true within the options. This builds one or more walls that do not join end to start. After building the main walls you can add interior walls by giving positional coordinates, based on the base data. As the walls are given thickness in the direction away from the origin if you find the depth of the wall is on the wrong side just reverse the corner coordinates in the  array, ie [4, 2, 4, 8] becomes [4, 8, 4,2].

Here are some of examples

http://www.babylonjs-playground.com/#P3N8ZF#1

http://www.babylonjs-playground.com/#P3N8ZF#2

http://www.babylonjs-playground.com/#P3N8ZF#3

Doors and windows should work but have yet to try that.

 

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...