Page 1 of 1

Polyline 2D display problem

Posted: Fri Dec 07, 2018 11:28 am
by Jälv
Hello,

When I load a Shape file that contains 2D polylines and that I set the 2DMode to true, CloudCompare cannot zoom to the loaded polylines.
Here what is looks like.
Image
On the left I set the 2DMode to false (loading the 2D polyline as 3D) and it shows properly.
On the right I set the 2DMode to true and the viewer cannot zoom to it so the polylines are there but extremely tiny.

It seems that what is causing the problem is the ccPolyline::getOwnBB which sets the bBox as being invalid.

Code: Select all

ccBBox ccPolyline::getOwnBB(bool withGLFeatures/*=false*/)
{
	ccBBox emptyBox;
	getBoundingBox(emptyBox.minCorner(), emptyBox.maxCorner());
	ccLog::Print(QString("3D: %1 GL: %2").arg(!is2DMode()).arg(!withGLFeatures));
	emptyBox.setValidity((!is2DMode() || !withGLFeatures) && size() != 0); //a 2D polyline is considered as a purely 'GL' fature
	return emptyBox;
}
The validity is set to false because (is2DMode == true) => (!i2DMode == false) and !withGLFeatures == false

Is there something that can be done or should I force loading 2D polylines as 3D ?

Re: Polyline 2D display problem

Posted: Fri Dec 07, 2018 11:35 am
by daniel
Actually 2D polylines are not meant to be used / selected in the 3D world.

If the '2D' mode is enabled, CC considers that the polyline coordinates are expressed in pixels, and that the polyline should be displayed in screen space (i.e. overlayed on top of the 3D view). Therefore you can't select them, and they are modified by any 3D interaction (zoom, pan, rotation, etc.).

Re: Polyline 2D display problem

Posted: Fri Dec 07, 2018 11:40 am
by Jälv
Okay, I didn't know that, Thanks for the quick response

Re: Polyline 2D display problem

Posted: Fri Dec 07, 2018 12:29 pm
by daniel
Friday is my CloudCompare day :D