Hi,
I want to add some box(cube) which can enclosure a entity(for example a car or other some things) in the cloud point, and I want to record the center, dimensions and rotation of the box. Now I have some questions.
1. As the dimension of the box is scaled relatively to the bounding-box, So after I rotate the box, the shape of the box will change when I scale the box. Is there a way to change the dimension of the box without changing the shape?
2. After I scale the box, the dimension of the box is also same as before(I use the box function "getDimensions()" ). So How can I get the real dimension of the box after scaling?
I don't know if you understand me while my English is not very good. I will try my best to express, you can ask me if you have any questions.
only scale the dimensions of the box without scale the box relatively to the bounding-box
only scale the dimensions of the box without scale the box relatively to the bounding-box
- Attachments
-
- 无标题.jpg (78.49 KiB) Viewed 7918 times
Re: only scale the dimensions of the box without scale the box relatively to the bounding-box
When you are speaking of 'box', are you speaking about the bounding box of the entity, or about the box primitive (ccBox)?
Sorry I don't fully understand your questions.
Sorry I don't fully understand your questions.
Daniel, CloudCompare admin
Re: only scale the dimensions of the box without scale the box relatively to the bounding-box
Yes, the 'box' I mentioned before is the box primitive(ccBox).
Now my question is:
1. After I rotate the box primitive, the shape of the box primitive will change(as show in the attachments) when I scale the box primitive. So is there a way to only scale the dimension of the box primitive without changing the shape after rotate it?
2. When I want to get the length, width and height of the box primitive, I just get the box primitive bounding box using the entity function 'getDimensions()'. How to get the length, width and height of the box primitive rather than primitive bounding box?
Now my question is:
1. After I rotate the box primitive, the shape of the box primitive will change(as show in the attachments) when I scale the box primitive. So is there a way to only scale the dimension of the box primitive without changing the shape after rotate it?
2. When I want to get the length, width and height of the box primitive, I just get the box primitive bounding box using the entity function 'getDimensions()'. How to get the length, width and height of the box primitive rather than primitive bounding box?
Re: only scale the dimensions of the box without scale the box relatively to the bounding-box
1. How do you 'scale' the box primitive?
Anyway we could add the possibility to edit the box dimensions in the properties tab (just as the sphere radius, etc.). But programmatically we would do this with 'setDimensions'.
2. The 'getDimensions' method actually returns the real box dimensions. The bounding-box dimensions are returned by the 'getOwnBB' method.
Anyway we could add the possibility to edit the box dimensions in the properties tab (just as the sphere radius, etc.). But programmatically we would do this with 'setDimensions'.
2. The 'getDimensions' method actually returns the real box dimensions. The bounding-box dimensions are returned by the 'getOwnBB' method.
Daniel, CloudCompare admin
Re: only scale the dimensions of the box without scale the box relatively to the bounding-box
Thanks, daniel
1. I use the Multiply/Scale tool to scale the box primitive.
2. After I scale the box primitive, the dimensions of the box (use function 'getDimensions()' ) is not change. It's too weird..
1. I use the Multiply/Scale tool to scale the box primitive.
2. After I scale the box primitive, the dimensions of the box (use function 'getDimensions()' ) is not change. It's too weird..
Re: only scale the dimensions of the box without scale the box relatively to the bounding-box
Indeed the 'Multiply/Scale' method doesn't change the box dimensions as it considers the primitive as a simple triangular mesh. Therefore it only changes its vertices coordinates.
You have to call 'setDimensions' on the box (you could add a small interface in your plugin to do this, or we could add this option to the properties tab).
You have to call 'setDimensions' on the box (you could add a small interface in your plugin to do this, or we could add this option to the properties tab).
Daniel, CloudCompare admin