Question regarding the origin point of a construction plane created with Plane.createUsingDirections and setting Bounding box

Question regarding the origin point of a construction plane created with Plane.createUsingDirections and setting Bounding box

charles-olivier.lamarche
Participant Participant
1,265 Views
1 Reply
Message 1 of 2

Question regarding the origin point of a construction plane created with Plane.createUsingDirections and setting Bounding box

charles-olivier.lamarche
Participant
Participant

Hi,

As of now, in my code base, I am creating construction planes with the planeInput->setByDistanceOnPath method which allows me to get the construction plane centered on the origin, and corresponds to the starting point of the line entity passed as the first argument of the method. This greatly facilitates my next step where I set the bounding box of the construction plane like a rectangle. The first file attachment illustrates the result. (Plane_setByDistanceOnPath.png)

 

Now, I would like to know if there is a way to obtain the same result (construction plane centered on origin) with another method I am trying that would eliminate the need to create a sketch line. This method is : 

 

 

planeInput = planes.createInput()

planeInput.targetBaseOrFormFeature = baseFeat

origin = adsk.core.Point3D.create(0, 0, 0)
xAxis = adsk.core.Vector3D.create(1, 0, 0)
yAxis = adsk.core.Vector3D.create(0, 1, 0)

plane_test = adsk.core.Plane.createUsingDirections(origin, xAxis, yAxis)

planeInput.setByPlane(plane_test)
planes.add(planeInput)

 

 

The problem is I am not getting the construction plane centered on origin point. Instead, it is close to a corner,

like in the second image (Plane_createUsingDirections.png). It seems to be affecting the way the bounding box is set and it's difficult to understand what's going on.

 

I am unable to replicate a Plane accurately that comes from another software with it's origin, normal, Xdirection, length and height. Any pointers toward another solution are welcome

 

Thank you,

Charles

0 Likes
Accepted solutions (1)
1,266 Views
1 Reply
Reply (1)
Message 2 of 2

Jorge_Jaramillo
Collaborator
Collaborator
Accepted solution

Hi @charles-olivier.lamarche ,

 

The construction planes you create based on one of the planes of the model's origin (XY, YZ, XZ) always have the origin in the center point ("O") of the 3D space plus the displacement from the plane.

If the construction plane was create based on any other surface, the origin is the center of that surface.

 

In the first case, that's is why you get the origin in a corner, while in the second case, it is at the center of the projected surface.

 

To solve your problem, always use construction planes that are derived from any surface, other than the model's origin.

 

Hope this could solve your question, if I understood it right.

 

Regards,

Jorge

 

0 Likes