DGtal-team / DGtal

Digital Geometry Tools and Algorithm Library
https://dgtal.org
GNU Lesser General Public License v3.0
370 stars 115 forks source link

Problem with viwer3D in the "BoundingBox" mode and the ArithmeticalDSS3d #707

Closed copyme closed 10 years ago

copyme commented 11 years ago

Right now I've been working with DGtal 0.6 and I have a trouble with the Viewer3D and the ArithmeticalDSS3d. Sometimes if I try to show DSSs in a "BoundingBox" mode I get an error: "Warning quad not added due to identical vertex..." and bounding boxes are wrongly drawn like on this picture:

http://mediagoblin.com/u/copyme/m/wrong-bounding-boxes-of-dsss/

Moreover I wrote a simple example which produce problem: https://www.wuala.com/hilsim/Bugs/DGTal/?key=ghsyUCKCLtzp

bbox dsss

kerautret commented 10 years ago

Thank for this issue, I checked with the actual version and same pb, I look it

kerautret commented 10 years ago

@troussil I have applied some checks and the pb looks to be related to the omega value from a.getParameters(v,mu,omega) given in Display3DFactory.h @troussil can you check it ? I have tested to set manually the omega value and a better display appears: capture decran 2013-10-29 a 10 07 07

kerautret commented 10 years ago

To be more efficient @troussil I send you a main updated with current DGtal version

kerautret commented 10 years ago

@copyme , alternatively you can also use the default mode (just remove the line setMode3D), and then change the color just before displaying your DSS like that:

while(t_DSS.end() != t_end && t_DSS.extendForward());
    t_start = t_DSS.end();
if(i%2==0)
  viewer << CustomColors3D( DGtal::Color(200, 0, 0, 200), DGtal::Color(200, 0, 0, 200) );
    else
  viewer << CustomColors3D( DGtal::Color(200, 200, 0, 200), DGtal::Color(200, 200, 0, 200) );
viewer << t_DSS;

You will obtain something like that: capture decran 2013-10-29 a 10 25 28 and if you want more color, you can also use HueShadeColorMap class of DGtal (and you can also have a look to 3dCurveViewer of DGtalTools (with also the bug but with example of projections)

kerautret commented 10 years ago

Example of curve display with 3dCurveViewer of DGtalTools capture decran 2013-10-29 a 10 27 58

troussil commented 10 years ago

Actually, when all the points of a given DSS have (at least) one same coordinate (e.g. all the x-coordinates are equal to 5), the bounding box is flat and the quads, which are degenerated into a straight segment or even a unique point, are not drawn.
This case should be tested during the display in order to avoid to print any error message.

kerautret commented 10 years ago

I put it on 0.8 due to lake of time ;(

kerautret commented 10 years ago

I close since already corrected and merged