Is there a way to judge a edge is through face or not?
-
What is it you really want to know about it? You should be able to orbit around and see that the edge passes through the face.
Why would you need a plugin to see this?
-
@dave r said:
What is it you really want to know about it? You should be able to orbit around and see that the edge passes through the face.
I mean have any plugins to do it?
-
As I already asked, why do you need a plugin to see if the edge passes through the face?
Maybe you could explain what you really need to do.
-
@youngosg said:
I mean have any plugins to do it?
Probably not but would be easy enough to create one. How would want it to work?
-
-
@dave r said:
As I already asked, why do you need a plugin to see if the edge passes through the face?
Maybe you could explain what you really need to do.
i have a cube . and i konw the center of the cube ,and a point outside the cube. connect this two point , i want to konw which face will be through?
-
Simple way.
Get the 'vector
' from the center-point [point1
] to the other external-point [point2
].
vector = point1.vector_to(point2)
Now do a 'raytest
': using...
raytest = Sketchup.active_model.raytest([point1, vector])
The 'raytest
' will benil
if nothing is hit, BUT since you say there is always geometry surroundingpoint1
that should never occur.
So it succeeds and returns an array with two elements:raytest[0]
is thepoint
of intersection and the second element,raytest[1]
is an array: that array contains the 'hits' in nested order - with any geometry listed last.
So the last itemraytest[1][-1]
is a reference to the 'face' that is intersected.
Note that it might be an 'edge' if the points and geometry are such that the 'ray' passes through the intersection of two or more faces.
Other elements in that array [if any] represent the 'container' references - like group or component if applicable - these are in nested order... -
@tig said:
Simple way.
Get the 'vector
' from the center-point [point1
] to the other external-point [point2
].
vector = point1.vector_to(point2)
Now do a 'raytest
': using...
raytest = Sketchup.active_model.raytest([point1, vector])
The 'raytest
' will benil
if nothing is hit, BUT since you say there is always geometry surroundingpoint1
that should never occur.
So it succeeds and returns an array with two elements:raytest[0]
is thepoint
of intersection and the second element,raytest[1]
is an array: that array contains the 'hits' in nested order - with any geometry listed last.
So the last itemraytest[1][-1]
is a reference to the 'face' that is intersected.
Note that it might be an 'edge' if the points and geometry are such that the 'ray' passes through the intersection of two or more faces.
Other elements in that array [if any] represent the 'container' references - like group or component if applicable - these are in nested order...thanks.it works.
-
-
I would just draw a guideline through both points, no need for complicated scripts or plugins ^^
-
@fluffy82 said:
I would just draw a guideline through both points, no need for complicated scripts or plugins ^^
The OP did ask for a Plugin that did this...
But yes, there are many ways to judge this 'visually'...
Advertisement