Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Determine where 2 extruded lines intersect

Determine where 2 extruded lines intersect

kenc
Advocate Advocate
3,449 Views
36 Replies
Message 1 of 37

Determine where 2 extruded lines intersect

kenc
Advocate
Advocate

If I have 2 walls(lines) crossing over or one of them is just touching the other, how do I determine at what point they intersect.

 

TIA

Ken

0 Likes
Accepted solutions (1)
3,450 Views
36 Replies
Replies (36)
Message 2 of 37

denisT.MaxDoctor
Advisor
Advisor

I'd love to help you, but you're on my blacklist. I don't appreciate it when someone claims “solutions” for themselves, even if they are their own. You have eight “solutions,” all marked by you. That's not how things should work. 
☝️

0 Likes
Message 3 of 37

kenc
Advocate
Advocate

I'm sorry. I thought that is what I was supposed to do

0 Likes
Message 4 of 37

kenc
Advocate
Advocate

Who marks it as a solution?

0 Likes
Message 5 of 37

kenc
Advocate
Advocate

@denisT.MaxDoctor I just went through our previous threads and I do see what I did wrong.

In those I accepted solution. Also noticed 2 real old threads with marked accept solution by the moderator

0 Likes
Message 6 of 37

denisT.MaxDoctor
Advisor
Advisor

are we talking about Bezie splines or just a simple Linear?

 

are we talking about 2D intersections? meaning projection 

0 Likes
Message 7 of 37

kenc
Advocate
Advocate

@denisT.MaxDoctor I am talking about 3D linear walls. The point when one wall touches or passes through another wall.

 

kenc_0-1721739989049.jpeg

 

0 Likes
Message 8 of 37

MartinBeh
Advisor
Advisor

You don't mention what you want to do once you have the intersection, but 3ds Max has the "Section" shape which computes the intersection of a mesh with a plane - does that help?

Martin B   EESignature
→ please 'Like' posts that are helpful; if a post answers your question please click the "Accept Solution" button.
0 Likes
Message 9 of 37

kenc
Advocate
Advocate

@MartinBeh Where Line002 crosses Line001. I need to divide Line001 in two.

0 Likes
Message 10 of 37

MartinBeh
Advisor
Advisor

So you want to cut one plane along the line of intersection of that plane with another?

 

You could use a Slice modifier for this. If you want, you could remote-control the modifier's gizmo with the gizmoControl script of mine.

Or maybe the Procutter compound would be a way to do that?

Martin B   EESignature
→ please 'Like' posts that are helpful; if a post answers your question please click the "Accept Solution" button.
0 Likes
Message 11 of 37

kenc
Advocate
Advocate

I better expand on what I need to do. I should have done this from the start.

I have a house full of walls. I have to check which wall intersects with what walls. I can do this with

intersects $Wall001 $Wall002.

When I find a wall that intersects another wall that wall needs to be split in two.

Here is an example

kenc_0-1721745956328.jpeg

 

Wall005 and Wall006 intersect with Wall001. I need Wall005 to split Wall001 in two. As well as Wall006 to split it in two.

 

I am using MAX 2019

0 Likes
Message 12 of 37

denisT.MaxDoctor
Advisor
Advisor

Typically, in any architectural project, “wall line” refers to a horizontal line (floor plan), not a vertical line. In this case, we can talk about the intersection in 2D (floor), or in 3D, assuming there is another vector making the wall plane “UP”.

 

If you use a vertical line for the wall, you need another vector to define the wall plane... where to get it?

0 Likes
Message 13 of 37

kenc
Advocate
Advocate

@denisT.MaxDoctor I'm not following what you are getting at.

The walls are extruded lines and then collapsed to edit poly.

0 Likes
Message 14 of 37

denisT.MaxDoctor
Advisor
Advisor

@kenc wrote:

@denisT.MaxDoctor I'm not following what you are getting at.

The walls are extruded lines and then collapsed to edit poly.


 

Walls are usually extruded vertically. In your original pipeline, they are extruded horizontally. Maybe it makes sense to modify the pipeline first?

0 Likes
Message 15 of 37

kenc
Advocate
Advocate

@denisT.MaxDoctor  in both my screenshots above, the walls are extruded vertically

0 Likes
Message 16 of 37

denisT.MaxDoctor
Advisor
Advisor

@kenc wrote:

@denisT.MaxDoctor  in both my screenshots above, the walls are extruded vertically


According to this picture, the lines are vertical.

denisTMaxDoctor_0-1721765521697.png

 

 

 

Well, uh. What do you need? Math, how do you calculate the intersecting point of two segments?

 

0 Likes
Message 17 of 37

denisT.MaxDoctor
Advisor
Advisor
Accepted solution
fn segs_cross_point p11 p12 p21 p22 = 
(
	a = p12 - p11
	b = p22 - p21
	c = p21 - p11

	mag = cross a b
	len = (length mag) ^ 2

	p0 = p11 + a * (dot (cross c b) mag)/len
	p1 = p21 + b * (dot (cross c a) mag)/len

	(p0 + p1)/2
)

delete objects
--seed (timestamp())

p11 = point name:#p11 pos:(random -[100,100,0] [100,100,0]) cross:on wirecolor:green
p12 = point name:#p12 pos:(random -[100,100,0] [100,100,0]) cross:on wirecolor:green

p21 = point name:#p21 pos:(random -[100,100,0] [100,100,0]) cross:on wirecolor:yellow
p22 = point name:#p22 pos:(random -[100,100,0] [100,100,0]) cross:on wirecolor:yellow


v = segs_cross_point p11.pos p12.pos p21.pos p22.pos
cp = point name:#cross pos:v cross:on wirecolor:red
Message 18 of 37

kenc
Advocate
Advocate

@denisT.MaxDoctor and how to break the wall at the intersection.

 

Wow, high school math. I was not expecting that.

I thought there would have been a built-in function to determine the point of intersection. Like intersects $Wall001 $Wall002. It determines if they intersect but no function to determine the point of intersection.

0 Likes
Message 19 of 37

MartinBeh
Advisor
Advisor

What intersects really does is:

Returns true if the bounding boxes of the two specified nodes overlap, or false if they do not overlap

Martin B   EESignature
→ please 'Like' posts that are helpful; if a post answers your question please click the "Accept Solution" button.
0 Likes
Message 20 of 37

kenc
Advocate
Advocate

@MartinBeh What I'm saying is if script can determine an intersection occurring, then why not determine the point of intersection.

0 Likes