How do i find the intersection point between a line and a patch?

3 Ansichten (letzte 30 Tage)
Kamil Amari
Kamil Amari am 19 Nov. 2019
Kommentiert: darova am 20 Nov. 2019
Hello,
In order to find the intersection between a line and a patch object, I typed :
[p1 p2 p3] = deal([1 0 0],[0 1 0],[0 0 1]); % creating 3 points that define a triangle
G = [1/3 1/3 1/3];
origin = [0 0 0];
P = [G',origin'];
l = line(P(1),P(2),P(3)); %the line I'm studying
obj = patch('Faces',[1 2 3],'Vertices',[p1;p2;p3]); %my patch object for simplification
I = intersect(p,l);
The problem is that the intersection I is a 1x0 patch with empty properties.
  3 Kommentare
Kamil Amari
Kamil Amari am 20 Nov. 2019
I get that you can do that for a triangle, but what if I have a more complex polygon? In fact I want to use this on an object made of 8000 faces and calculating the intersection between lines and each faces takes 60s.
darova
darova am 20 Nov. 2019
Try function from fileexchange: LINK

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by