@@ -77,7 +77,7 @@ public class Manifold3D extends Group {
7777
7878 public Manifold3D (List <Point3D > point3DList , boolean triangulate , boolean makeLines , boolean makePoints , Double tolerance ) {
7979 originalPoint3Ds = point3DList ;
80- buildHullMesh (point3DList , triangulate , makeLines , makePoints , tolerance );
80+ buildHullMesh (point3DList , triangulate , tolerance );
8181
8282 List <Point3D > fxyzPoints = new ArrayList <>();
8383 for (int i = 0 ; i < hull .getNumVertices (); i ++) {
@@ -349,7 +349,7 @@ public void refreshMesh(List<Point3D> point3DList, boolean triangulate, boolean
349349 quickhullLinesTriangleMesh .getPoints ().clear ();
350350 quickhullLinesTriangleMesh .getTexCoords ().clear ();
351351 quickhullLinesTriangleMesh .getFaces ().clear ();
352- buildHullMesh (point3DList , triangulate , makeLines , makePoints , tolerance );
352+ buildHullMesh (point3DList , triangulate , tolerance );
353353 quickhullMeshView .setMesh (quickhullTriangleMesh );
354354 if (makeLines ) {
355355 quickhullLinesTriangleMesh .getPoints ().addAll (quickhullTriangleMesh .getPoints ());
@@ -361,7 +361,7 @@ public void refreshMesh(List<Point3D> point3DList, boolean triangulate, boolean
361361// makeDebugPoints(hull, artScale, false);
362362 }
363363
364- private void buildHullMesh (List <Point3D > point3DList , boolean triangulate , boolean makeLines , boolean makePoints , Double tolerance ) {
364+ private void buildHullMesh (List <Point3D > point3DList , boolean triangulate , Double tolerance ) {
365365 hull = new QuickHull3D ();
366366 if (null != tolerance )
367367 hull .setExplicitDistanceTolerance (tolerance );
@@ -455,19 +455,21 @@ public void handle(long now) {
455455 }
456456
457457 public void makeLines () {
458+ boolean wasVisible = null != quickhullLinesMeshView
459+ ? quickhullLinesMeshView .isVisible () : false ;
458460 quickhullLinesTriangleMesh = new TriangleMesh ();
459461 quickhullLinesTriangleMesh .getPoints ().addAll (quickhullTriangleMesh .getPoints ());
460462 quickhullLinesTriangleMesh .getTexCoords ().addAll (quickhullTriangleMesh .getTexCoords ());
461463 quickhullLinesTriangleMesh .getFaces ().addAll (quickhullTriangleMesh .getFaces ());
462464
463465 quickhullLinesMeshView = new MeshView (quickhullLinesTriangleMesh );
464- PhongMaterial quickhullLinesMaterial = new PhongMaterial (Color .BLUE );
465- quickhullLinesMaterial .setSpecularColor (Color .BLUE ); //fix for aarch64 Mac Ventura
466+ PhongMaterial quickhullLinesMaterial = new PhongMaterial (Color .ALICEBLUE );
467+ quickhullLinesMaterial .setSpecularColor (Color .ALICEBLUE ); //fix for aarch64 Mac Ventura
466468 quickhullLinesMeshView .setMaterial (quickhullLinesMaterial );
467469 quickhullLinesMeshView .setDrawMode (DrawMode .LINE );
468470 quickhullLinesMeshView .setCullFace (CullFace .NONE );
469471 quickhullLinesMeshView .setMouseTransparent (true );
470-
472+ quickhullLinesMeshView . setVisible ( wasVisible );
471473 getChildren ().add (quickhullLinesMeshView );
472474 }
473475
@@ -489,14 +491,15 @@ public void makeDebugPoints(QuickHull3D hull, float scale, boolean print) {
489491 sb .append (", " );
490492 }
491493
492- Sphere sphere = new Sphere (2 .5 );
493- PhongMaterial mat = new PhongMaterial (Color .BLUE );
494- mat .setSpecularColor (Color .BLUE ); // fix for aarch64 Mac Ventura
494+ Sphere sphere = new Sphere (1 .5 );
495+ PhongMaterial mat = new PhongMaterial (Color .ALICEBLUE );
496+ mat .setSpecularColor (Color .ALICEBLUE ); // fix for aarch64 Mac Ventura
495497 sphere .setMaterial (mat );
496498 sphere .setTranslateX (point3D .x );
497499 sphere .setTranslateY (point3D .y );
498500 sphere .setTranslateZ (point3D .z );
499501 extrasGroup .getChildren ().add (sphere );
502+ sphere .setVisible (false );
500503
501504 Label newLabel = new Label (String .valueOf (i ));
502505 labelGroup .getChildren ().addAll (newLabel );
0 commit comments