A bunch of Ruby questions
-
Well, I have a bunch of questions, so instead of doing a bunch of different topics, I decided to just do one.
Is there any way to find the opposite face of a rectangular block without using a raytest?
Is it better to add a group to a component and draw new entities inside or better to draw the entities and then group them?
Is there any way to change the axis of a component without using transformations?
Can you tell whether a part is drawn by the component axes or global?
Is there a way to dynamically change the face an entity is drawn on?
Can you get the global location of a component without using BoundingBox?
-
Hi Chris,
@cjthompson said:
Well, I have a bunch of questions, so instead of doing a bunch of different topics, I decided to just do one.
Is there any way to find the opposite face of a rectangular block without using a raytest?
You could maybe compare the direction of the face's normals.
@unknownuser said:
Is it better to add a group to a component and draw new entities inside or better to draw the entities and then group them?
The API docs say it is preferable to create an empty group and then add to it. If the entities do not already exist, go ahead and create the group first.
@unknownuser said:
Is there any way to change the axis of a component without using transformations?
No. You would need to redraw around the desired axes.
@unknownuser said:
Can you tell whether a part is drawn by the component axes or global?
Is there a way to dynamically change the face an entity is drawn on?Not sure what you mean.
@unknownuser said:
Can you get the global location of a component without using BoundingBox?
Yes, instance.transformation.origin will give you the location.
-
thanks for the quick responses.
to clarify the question about adding the entity to faces dynamically, I was wondering if it is possible to place an entity on a face in 2 dimensions, disregarding depth, and still be able to reference it in 3 dimensions.
-
@cjthompson said:
Is there any way to find the opposite face of a rectangular block without using a raytest?
I made a function in my Selection Toys plugin that selects the opposite face. Doesn't use ray testing though. I lops over the connected geometry and finds the nearest opposite face. You can poke around in the code for that if you like.
Advertisement