From cc34552e350c08fd22e20dcd6a5112b270a3aae0 Mon Sep 17 00:00:00 2001 From: Scott Vorthmann Date: Wed, 6 Nov 2024 13:19:27 -0600 Subject: [PATCH] Added short strut mechanism ExportedVEFStrutGeometry can now have a fallback for when the geometry does not work. If any non-tip vertex computed is further from the origin than some tip vertex, the fallback geometry is tried, or null is returned if there is no fallback. I'm using FastDefaultStrutGeometry as a default fallback, so there should always be a strut rendered; this should retain invariants from before. In particular, switching styles will do the right thing as long as every strut is rendered; if a strut does not get rendered, it cannot be recovered by switching styles. This solves Paul's issue with "inside-out" r00 struts, but it goes much further, and avoids rendering *any* inside-out struts except for the very short default struts. --- .../core/render/RenderedManifestation.java | 2 + .../vzome/core/viewing/ExportedVEFShapes.java | 25 +- .../viewing/ExportedVEFStrutGeometry.java | 29 +- .../vzome/core/parts/default/red-short.vZome | 604 ++++++++++++++++++ .../vzome/core/parts/default/red-short.vef | 39 ++ .../core/parts/default/yellow-short.vZome | 406 ++++++++++++ .../vzome/core/parts/default/yellow-short.vef | 32 + .../vzome/core/parts/lifelike/red-short.vZome | 415 ++++++++++++ .../vzome/core/parts/lifelike/red-short.vef | 82 +++ .../core/parts/lifelike/yellow-short.vZome | 274 ++++++++ .../core/parts/lifelike/yellow-short.vef | 60 ++ .../resources/com/vzome/core/parts/moves.sh | 4 + online/src/worker/legacy/core-java.js | 73 ++- .../com/vzome/core/parts/default/index.js | 4 + .../vzome/core/parts/default/red-short.vef | 39 ++ .../vzome/core/parts/default/yellow-short.vef | 32 + .../com/vzome/core/parts/lifelike/index.js | 4 + .../vzome/core/parts/lifelike/red-short.vef | 82 +++ .../core/parts/lifelike/yellow-short.vef | 60 ++ online/src/worker/legacy/ts/core-java.ts | 75 ++- 20 files changed, 2288 insertions(+), 53 deletions(-) create mode 100644 core/src/main/resources/com/vzome/core/parts/default/red-short.vZome create mode 100644 core/src/main/resources/com/vzome/core/parts/default/red-short.vef create mode 100644 core/src/main/resources/com/vzome/core/parts/default/yellow-short.vZome create mode 100644 core/src/main/resources/com/vzome/core/parts/default/yellow-short.vef create mode 100644 core/src/main/resources/com/vzome/core/parts/lifelike/red-short.vZome create mode 100644 core/src/main/resources/com/vzome/core/parts/lifelike/red-short.vef create mode 100644 core/src/main/resources/com/vzome/core/parts/lifelike/yellow-short.vZome create mode 100644 core/src/main/resources/com/vzome/core/parts/lifelike/yellow-short.vef create mode 100644 online/src/worker/legacy/resources/com/vzome/core/parts/default/red-short.vef create mode 100644 online/src/worker/legacy/resources/com/vzome/core/parts/default/yellow-short.vef create mode 100644 online/src/worker/legacy/resources/com/vzome/core/parts/lifelike/red-short.vef create mode 100644 online/src/worker/legacy/resources/com/vzome/core/parts/lifelike/yellow-short.vef diff --git a/core/src/main/java/com/vzome/core/render/RenderedManifestation.java b/core/src/main/java/com/vzome/core/render/RenderedManifestation.java index 796ca817d..ad5bf2555 100644 --- a/core/src/main/java/com/vzome/core/render/RenderedManifestation.java +++ b/core/src/main/java/com/vzome/core/render/RenderedManifestation.java @@ -434,6 +434,8 @@ protected void resetStrutAttributes( Strut strut ) AlgebraicNumber len = axis .getLength( offset ); Polyhedron prototypeLengthShape = shapes .getStrutShape( orbit, len ); + if ( prototypeLengthShape == null ) + return; // This happens for very short struts, when the shape would be inside-out this .mShape = prototypeLengthShape; int orn = axis .getOrientation(); diff --git a/core/src/main/java/com/vzome/core/viewing/ExportedVEFShapes.java b/core/src/main/java/com/vzome/core/viewing/ExportedVEFShapes.java index 1d463f746..7d30026c2 100644 --- a/core/src/main/java/com/vzome/core/viewing/ExportedVEFShapes.java +++ b/core/src/main/java/com/vzome/core/viewing/ExportedVEFShapes.java @@ -26,6 +26,7 @@ import com.vzome.core.math.symmetry.Axis; import com.vzome.core.math.symmetry.Direction; import com.vzome.core.math.symmetry.Symmetry; +import com.vzome.core.parts.FastDefaultStrutGeometry; import com.vzome.core.parts.StrutGeometry; import com.vzome.core.render.Colors; import com.vzome.xml.ResourceLoader; @@ -121,14 +122,26 @@ protected Polyhedron buildConnectorShape(String pkgName) { } @Override - protected StrutGeometry createStrutGeometry(Direction dir) { + protected StrutGeometry createStrutGeometry(Direction dir) + { // automatic struts don't use VEF so don't waste time trying - if (!dir.isAutomatic()) { - String vefData = loadVefData(dir.getName()); + if ( ! dir.isAutomatic() ) { + + StrutGeometry shortGeometry = new FastDefaultStrutGeometry( dir ); + String vefData = loadVefData( dir.getName() + "-short" ); + if (vefData != null) { + VefToShape parser = new VefToShape(); + parser .parseVEF( vefData, mSymmetry.getField() ); + shortGeometry = parser .getStrutGeometry( dir.getAxis( Symmetry.PLUS, 0 ) .normal()); + } + + vefData = loadVefData( dir.getName( )); if (vefData != null) { VefToShape parser = new VefToShape(); - parser.parseVEF(vefData, mSymmetry.getField()); - return parser.getStrutGeometry(dir.getAxis(Symmetry.PLUS, 0).normal()); + parser .parseVEF( vefData, mSymmetry.getField() ); + ExportedVEFStrutGeometry geometry = parser .getStrutGeometry( dir.getAxis( Symmetry.PLUS, 0 ) .normal()); + geometry .setShortGeometry( shortGeometry ); + return geometry; } // strut uses finer logging level than connector since strut fallback is more common. final Level logLevel = Level.FINER; @@ -204,7 +217,7 @@ private class VefToShape extends VefParser private boolean invertSnubBall = false; - public StrutGeometry getStrutGeometry( AlgebraicVector prototype ) + public ExportedVEFStrutGeometry getStrutGeometry( AlgebraicVector prototype ) { // next, get the arbitrary axis that the strut model lies along Axis tipAxis = mSymmetry .getAxis( tipVertex ); diff --git a/core/src/main/java/com/vzome/core/viewing/ExportedVEFStrutGeometry.java b/core/src/main/java/com/vzome/core/viewing/ExportedVEFStrutGeometry.java index 9a9badf17..b79cee673 100644 --- a/core/src/main/java/com/vzome/core/viewing/ExportedVEFStrutGeometry.java +++ b/core/src/main/java/com/vzome/core/viewing/ExportedVEFStrutGeometry.java @@ -30,6 +30,8 @@ public class ExportedVEFStrutGeometry implements StrutGeometry public final Set fullScaleVertices, halfScaleVertices; // the polyhedron vertices that must adjust for different strut lengths + private StrutGeometry shortGeometry = null; + public ExportedVEFStrutGeometry( List vertices, List< List > faces, AlgebraicVector prototype, Set fullScaleVertices, Set halfScaleVertices, AlgebraicField field ) { prototypeVertices = vertices; @@ -54,6 +56,10 @@ public List getTriangles() public Polyhedron getStrutPolyhedron( AlgebraicNumber length ) { AlgebraicVector tipVertex = prototypeVector .scale( length ); + + double maxNonTipDistance = 0; + double minTipDistance = tipVertex .toRealVector() .length(); + AlgebraicVector midpoint = tipVertex .scale( this .field .createRational( 1, 2 ) ); if ( field .getName() .equals( "snubDodec" ) && LOGGER.isLoggable(Level.FINE) ) { @@ -67,11 +73,25 @@ public Polyhedron getStrutPolyhedron( AlgebraicNumber length ) AlgebraicVector vertex = prototypeVertices .get( i ); if ( fullScaleVertices .contains(i) ) { vertex = vertex .plus( tipVertex ); - } else if ( halfScaleVertices != null && halfScaleVertices .contains(i) ) { - vertex = vertex .plus( midpoint ); + minTipDistance = Math.min( minTipDistance, vertex .toRealVector() .length() ); + } else { + if ( halfScaleVertices != null && halfScaleVertices .contains(i) ) { + vertex = vertex .plus( midpoint ); + } + maxNonTipDistance = Math.max( maxNonTipDistance, vertex .toRealVector() .length() ); } result .addVertex( vertex ); } + + if ( maxNonTipDistance > minTipDistance ) { + // The strut shape will be partially inverted, so we don't want to use it. + if ( shortGeometry != null ) { + return shortGeometry .getStrutPolyhedron( length ); + } + else + return null; + } + for (List prototypeFace : prototypeFaces) { Polyhedron.Face face = result .newFace(); face .addAll( prototypeFace ); @@ -79,4 +99,9 @@ public Polyhedron getStrutPolyhedron( AlgebraicNumber length ) } return result; } + + public void setShortGeometry( StrutGeometry shortGeometry ) + { + this.shortGeometry = shortGeometry; + } } diff --git a/core/src/main/resources/com/vzome/core/parts/default/red-short.vZome b/core/src/main/resources/com/vzome/core/parts/default/red-short.vZome new file mode 100644 index 000000000..e7114cedf --- /dev/null +++ b/core/src/main/resources/com/vzome/core/parts/default/red-short.vZome @@ -0,0 +1,604 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/src/main/resources/com/vzome/core/parts/default/red-short.vef b/core/src/main/resources/com/vzome/core/parts/default/red-short.vef new file mode 100644 index 000000000..e042c26da --- /dev/null +++ b/core/src/main/resources/com/vzome/core/parts/default/red-short.vef @@ -0,0 +1,39 @@ +vZome VEF 6 field golden + +11 +(0,0) (-1/2,1/2) (-1/2,-1) (0,-1) +(0,0) (-1/2,1/2) (-1/2,0) (-1,1) +(0,0) (1/2,-1) (-1,0) (-1/2,-1/2) +(0,0) (1/2,-1) (0,-1) (-1/2,1/2) +(0,0) (0,0) (-1,-1) (-1,0) +(0,0) (0,0) (-3/2,1/2) (-1/2,0) +(0,0) (0,0) (1/2,-3/2) (-1/2,0) +(0,0) (-1/2,1) (-1,0) (-1/2,-1/2) +(0,0) (-1/2,1) (0,-1) (-1/2,1/2) +(0,0) (1/2,-1/2) (-1/2,-1) (0,-1) +(0,0) (1/2,-1/2) (-1/2,0) (-1,1) + + + +0 + + + +10 +3 0 5 3 +3 1 6 2 +3 2 0 1 +3 3 1 0 +3 5 9 8 +3 6 10 7 +3 7 2 6 +3 8 3 5 +3 9 7 10 +3 10 8 9 + + + +6 +0 2 4 5 7 9 + +tip 4 diff --git a/core/src/main/resources/com/vzome/core/parts/default/yellow-short.vZome b/core/src/main/resources/com/vzome/core/parts/default/yellow-short.vZome new file mode 100644 index 000000000..70c1008b5 --- /dev/null +++ b/core/src/main/resources/com/vzome/core/parts/default/yellow-short.vZome @@ -0,0 +1,406 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/src/main/resources/com/vzome/core/parts/default/yellow-short.vef b/core/src/main/resources/com/vzome/core/parts/default/yellow-short.vef new file mode 100644 index 000000000..731719933 --- /dev/null +++ b/core/src/main/resources/com/vzome/core/parts/default/yellow-short.vef @@ -0,0 +1,32 @@ +vZome VEF 6 field golden + +7 +(0,0) (1/2,0) (0,0) (-1/2,3/2) +(0,0) (0,1) (-1/2,1/2) (-1/2,1) +(0,0) (0,1) (1/2,-1/2) (-1/2,1) +(0,0) (1,0) (-1/2,1/2) (1/2,0) +(0,0) (1,0) (1/2,-1/2) (1/2,0) +(0,0) (1/2,1) (0,0) (1/2,-1/2) +(0,0) (1,1) (0,0) (0,1) + + + +0 + + + +6 +3 1 5 3 +3 3 0 1 +3 3 4 0 +3 4 2 0 +3 5 1 2 +3 5 2 4 + + + +4 +3 4 5 6 + +tip 6 + diff --git a/core/src/main/resources/com/vzome/core/parts/lifelike/red-short.vZome b/core/src/main/resources/com/vzome/core/parts/lifelike/red-short.vZome new file mode 100644 index 000000000..9076aa491 --- /dev/null +++ b/core/src/main/resources/com/vzome/core/parts/lifelike/red-short.vZome @@ -0,0 +1,415 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/src/main/resources/com/vzome/core/parts/lifelike/red-short.vef b/core/src/main/resources/com/vzome/core/parts/lifelike/red-short.vef new file mode 100644 index 000000000..1d162d26c --- /dev/null +++ b/core/src/main/resources/com/vzome/core/parts/lifelike/red-short.vef @@ -0,0 +1,82 @@ +vZome VEF 6 field golden + +31 +(0,0) (-1/2,1/2) (-1/2,-1) (0,-1) +(0,0) (-1/2,1/2) (-1/2,0) (-1,1) +(0,0) (1/2,-1) (-1,-1/2) (-2,2) +(0,0) (1/2,-1) (-8/5,4/5) (-7/10,1/10) +(0,0) (1/2,-1) (-1,0) (-1/2,-1/2) +(0,0) (1/2,-1) (0,-1) (-1/2,1/2) +(0,0) (1/2,-1) (3/5,-9/5) (-3/10,-1/10) +(0,0) (1/2,-1) (0,-1/2) (1,-2) +(0,0) (-1,3/2) (0,-2) (-3/2,1) +(0,0) (-1,3/2) (-3/5,-7/10) (-1/5,-9/10) +(0,0) (-1,3/2) (-2/5,-3/10) (-4/5,9/10) +(0,0) (-1,3/2) (-1,1) (1/2,-1) +(0,0) (0,0) (-1,-1) (-1,0) +(0,0) (0,0) (1/2,-3) (-1,1/2) +(0,0) (0,0) (-3/2,1/2) (-1/2,0) +(0,0) (0,0) (-1/10,-17/10) (3/10,-7/5) +(0,0) (0,0) (-9/10,7/10) (-13/10,7/5) +(0,0) (0,0) (1/2,-3/2) (-1/2,0) +(0,0) (0,0) (-3/2,2) (0,-1/2) +(0,0) (1,-3/2) (0,-2) (-3/2,1) +(0,0) (1,-3/2) (-3/5,-7/10) (-1/5,-9/10) +(0,0) (1,-3/2) (-2/5,-3/10) (-4/5,9/10) +(0,0) (1,-3/2) (-1,1) (1/2,-1) +(0,0) (-1/2,1) (-1,-1/2) (-2,2) +(0,0) (-1/2,1) (-8/5,4/5) (-7/10,1/10) +(0,0) (-1/2,1) (-1,0) (-1/2,-1/2) +(0,0) (-1/2,1) (0,-1) (-1/2,1/2) +(0,0) (-1/2,1) (3/5,-9/5) (-3/10,-1/10) +(0,0) (-1/2,1) (0,-1/2) (1,-2) +(0,0) (1/2,-1/2) (-1/2,-1) (0,-1) +(0,0) (1/2,-1/2) (-1/2,0) (-1,1) + + + +0 + + + +32 +3 0 14 5 +3 1 17 4 +3 4 0 1 +3 5 1 0 +3 14 29 26 +3 17 30 25 +3 25 4 17 +3 26 5 14 +3 29 25 30 +3 30 26 29 +4 2 3 9 8 +4 3 0 4 9 +4 6 1 5 10 +4 6 10 11 7 +4 10 5 26 21 +4 10 21 22 11 +4 15 3 2 13 +4 15 14 0 3 +4 16 17 1 6 +4 16 27 30 17 +4 18 16 6 7 +4 18 28 27 16 +4 20 9 4 25 +4 20 19 8 9 +4 20 24 23 19 +4 20 25 29 24 +4 23 24 15 13 +4 24 29 14 15 +4 26 30 27 21 +4 28 22 21 27 +5 18 7 11 22 28 +5 23 13 2 8 19 + + + +16 +0 2 3 4 8 9 12 13 14 15 +19 20 23 24 25 29 + +tip 12 diff --git a/core/src/main/resources/com/vzome/core/parts/lifelike/yellow-short.vZome b/core/src/main/resources/com/vzome/core/parts/lifelike/yellow-short.vZome new file mode 100644 index 000000000..fcf7a1afd --- /dev/null +++ b/core/src/main/resources/com/vzome/core/parts/lifelike/yellow-short.vZome @@ -0,0 +1,274 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/src/main/resources/com/vzome/core/parts/lifelike/yellow-short.vef b/core/src/main/resources/com/vzome/core/parts/lifelike/yellow-short.vef new file mode 100644 index 000000000..a69c22d9b --- /dev/null +++ b/core/src/main/resources/com/vzome/core/parts/lifelike/yellow-short.vef @@ -0,0 +1,60 @@ +vZome VEF 6 field golden + +19 +(0,0) (0,1/2) (0,0) (3/2,-2) +(0,0) (1,-1) (1/2,-1) (1,-3/2) +(0,0) (1,-1) (-1/2,1) (1,-3/2) +(0,0) (1/2,0) (0,0) (-1/2,3/2) +(0,0) (-1/2,5/3) (0,0) (-1/6,5/6) +(0,0) (1/2,1/6) (1/2,-1) (-2/3,4/3) +(0,0) (1/2,1/6) (-1/2,1) (-2/3,4/3) +(0,0) (0,1) (-1/2,1/2) (-1/2,1) +(0,0) (0,1) (1/2,-1/2) (-1/2,1) +(0,0) (1,0) (-1/2,1/2) (1/2,0) +(0,0) (1,0) (1/2,-1/2) (1/2,0) +(0,0) (1/2,5/6) (1/2,-1) (2/3,-1/3) +(0,0) (1/2,5/6) (-1/2,1) (2/3,-1/3) +(0,0) (3/2,-2/3) (0,0) (1/6,1/6) +(0,0) (1/2,1) (0,0) (1/2,-1/2) +(0,0) (0,2) (1/2,-1) (-1,5/2) +(0,0) (0,2) (-1/2,1) (-1,5/2) +(0,0) (1,1/2) (0,0) (-3/2,3) +(0,0) (1,1) (0,0) (0,1) + + + +0 + + + +20 +3 1 0 2 +3 7 14 9 +3 9 3 7 +3 9 10 3 +3 10 8 3 +3 14 7 8 +3 14 8 10 +3 17 16 15 +4 3 8 6 4 +4 4 6 2 0 +4 5 1 2 6 +4 5 4 0 1 +4 5 6 8 7 +4 5 7 3 4 +4 10 9 11 12 +4 10 12 13 14 +4 12 11 15 16 +4 14 13 11 9 +4 17 13 12 16 +4 17 15 11 13 + + + +10 +9 10 11 12 13 14 15 16 17 18 + +tip 18 + + + diff --git a/core/src/main/resources/com/vzome/core/parts/moves.sh b/core/src/main/resources/com/vzome/core/parts/moves.sh index 503a755f5..da7dfbc19 100755 --- a/core/src/main/resources/com/vzome/core/parts/moves.sh +++ b/core/src/main/resources/com/vzome/core/parts/moves.sh @@ -15,6 +15,8 @@ move ./lifelike/connector.vef move ./lifelike/blue.vef move ./lifelike/yellow.vef move ./lifelike/red.vef +move ./lifelike/yellow-short.vef +move ./lifelike/red-short.vef move ./lifelike/green.vef move ./heptagon/antiprism/connector.vef move ./heptagon/antiprism/blue.vef @@ -72,6 +74,8 @@ move ./default/olive.vef move ./default/apple.vef move ./default/lavender.vef move ./default/orange.vef +move ./default/yellow-short.vef +move ./default/red-short.vef move ./vienne2/connector.vef move ./vienne2/purple.vef move ./vienne2/orange.vef diff --git a/online/src/worker/legacy/core-java.js b/online/src/worker/legacy/core-java.js index e8211f115..c4bee4cd9 100644 --- a/online/src/worker/legacy/core-java.js +++ b/online/src/worker/legacy/core-java.js @@ -3411,6 +3411,8 @@ export var com; const orbit = axis.getDirection(); const len = axis.getLength(offset); const prototypeLengthShape = shapes.getStrutShape(orbit, len); + if (prototypeLengthShape == null) + return; this.mShape = prototypeLengthShape; const orn = axis.getOrientation(); const orientation = shapes.getSymmetry().getMatrix(orn); @@ -3952,8 +3954,8 @@ export var com; this.orbits = new com.vzome.core.math.symmetry.OrbitSet(symmetry); } /* Default method injected from com.vzome.core.editor.api.OrbitSource */ - getZone(orbit, orientation) { - return this.getSymmetry().getDirection(orbit).getAxis(com.vzome.core.math.symmetry.Symmetry.PLUS, orientation); + getOrientations$() { + return this.getOrientations(false); } /* Default method injected from com.vzome.core.editor.api.OrbitSource */ getEmbedding() { @@ -3979,10 +3981,6 @@ export var com; return embedding; } /* Default method injected from com.vzome.core.editor.api.OrbitSource */ - getOrientations$() { - return this.getOrientations(false); - } - /* Default method injected from com.vzome.core.editor.api.OrbitSource */ getOrientations(rowMajor) { if (((typeof rowMajor === 'boolean') || rowMajor === null)) { let __args = arguments; @@ -4036,6 +4034,10 @@ export var com; else throw new Error('invalid overload'); } + /* Default method injected from com.vzome.core.editor.api.OrbitSource */ + getZone(orbit, orientation) { + return this.getSymmetry().getDirection(orbit).getAxis(com.vzome.core.math.symmetry.Symmetry.PLUS, orientation); + } /** * * @param {com.vzome.core.math.symmetry.Direction} orbit @@ -4585,6 +4587,7 @@ export var com; if (this.halfScaleVertices === undefined) { this.halfScaleVertices = null; } + this.shortGeometry = null; this.prototypeVertices = vertices; this.prototypeFaces = faces; this.prototypeVector = prototype; @@ -4616,6 +4619,7 @@ export var com; if (this.halfScaleVertices === undefined) { this.halfScaleVertices = null; } + this.shortGeometry = null; this.prototypeVertices = vertices; this.prototypeFaces = faces; this.prototypeVector = prototype; @@ -4640,6 +4644,8 @@ export var com; */ getStrutPolyhedron(length) { const tipVertex = this.prototypeVector.scale(length); + let maxNonTipDistance = 0; + let minTipDistance = tipVertex.toRealVector().length(); const midpoint = tipVertex.scale(this.field['createRational$long$long'](1, 2)); if ((this.field.getName() === ("snubDodec")) && ExportedVEFStrutGeometry.LOGGER_$LI$().isLoggable(java.util.logging.Level.FINE)) { ExportedVEFStrutGeometry.LOGGER_$LI$().fine("proto length = " + this.prototypeVector.toRealVector().length()); @@ -4652,14 +4658,25 @@ export var com; let vertex = this.prototypeVertices.get(i); if (this.fullScaleVertices.contains(i)) { vertex = vertex.plus(tipVertex); + minTipDistance = Math.min(minTipDistance, vertex.toRealVector().length()); } - else if (this.halfScaleVertices != null && this.halfScaleVertices.contains(i)) { - vertex = vertex.plus(midpoint); + else { + if (this.halfScaleVertices != null && this.halfScaleVertices.contains(i)) { + vertex = vertex.plus(midpoint); + } + maxNonTipDistance = Math.max(maxNonTipDistance, vertex.toRealVector().length()); } result.addVertex(vertex); } ; } + if (maxNonTipDistance > minTipDistance) { + if (this.shortGeometry != null) { + return this.shortGeometry.getStrutPolyhedron(length); + } + else + return null; + } for (let index = this.prototypeFaces.iterator(); index.hasNext();) { let prototypeFace = index.next(); { @@ -4670,6 +4687,9 @@ export var com; } return result; } + setShortGeometry(shortGeometry) { + this.shortGeometry = shortGeometry; + } } viewing.ExportedVEFStrutGeometry = ExportedVEFStrutGeometry; ExportedVEFStrutGeometry["__class"] = "com.vzome.core.viewing.ExportedVEFStrutGeometry"; @@ -16761,8 +16781,8 @@ export var com; this.setStyle(styleName); } /* Default method injected from com.vzome.core.editor.api.OrbitSource */ - getZone(orbit, orientation) { - return this.getSymmetry().getDirection(orbit).getAxis(com.vzome.core.math.symmetry.Symmetry.PLUS, orientation); + getOrientations$() { + return this.getOrientations(false); } /* Default method injected from com.vzome.core.editor.api.OrbitSource */ getEmbedding() { @@ -16788,10 +16808,6 @@ export var com; return embedding; } /* Default method injected from com.vzome.core.editor.api.OrbitSource */ - getOrientations$() { - return this.getOrientations(false); - } - /* Default method injected from com.vzome.core.editor.api.OrbitSource */ getOrientations(rowMajor) { if (((typeof rowMajor === 'boolean') || rowMajor === null)) { let __args = arguments; @@ -16866,6 +16882,10 @@ export var com; else throw new Error('invalid overload'); } + /* Default method injected from com.vzome.core.editor.api.OrbitSource */ + getZone(orbit, orientation) { + return this.getSymmetry().getDirection(orbit).getAxis(com.vzome.core.math.symmetry.Symmetry.PLUS, orientation); + } static logger_$LI$() { if (SymmetrySystem.logger == null) { SymmetrySystem.logger = java.util.logging.Logger.getLogger("com.vzome.core.editor"); } return SymmetrySystem.logger; } @@ -26984,11 +27004,20 @@ export var com; */ createStrutGeometry(dir) { if (!dir.isAutomatic()) { - const vefData = this.loadVefData(dir.getName()); + let shortGeometry = new com.vzome.core.parts.FastDefaultStrutGeometry(dir); + let vefData = this.loadVefData(dir.getName() + "-short"); + if (vefData != null) { + const parser = new ExportedVEFShapes.VefToShape(this); + parser.parseVEF(vefData, this.mSymmetry.getField()); + shortGeometry = parser.getStrutGeometry(dir.getAxis$int$int(com.vzome.core.math.symmetry.Symmetry.PLUS, 0).normal()); + } + vefData = this.loadVefData(dir.getName()); if (vefData != null) { const parser = new ExportedVEFShapes.VefToShape(this); parser.parseVEF(vefData, this.mSymmetry.getField()); - return parser.getStrutGeometry(dir.getAxis$int$int(com.vzome.core.math.symmetry.Symmetry.PLUS, 0).normal()); + const geometry = parser.getStrutGeometry(dir.getAxis$int$int(com.vzome.core.math.symmetry.Symmetry.PLUS, 0).normal()); + geometry.setShortGeometry(shortGeometry); + return geometry; } const logLevel = java.util.logging.Level.FINER; if (ExportedVEFShapes.LOGGER_$LI$().isLoggable(logLevel)) { @@ -48038,8 +48067,8 @@ export var com; this.__parent = __parent; } /* Default method injected from com.vzome.core.editor.api.OrbitSource */ - getZone(orbit, orientation) { - return this.getSymmetry().getDirection(orbit).getAxis(com.vzome.core.math.symmetry.Symmetry.PLUS, orientation); + getOrientations$() { + return this.getOrientations(false); } /* Default method injected from com.vzome.core.editor.api.OrbitSource */ getEmbedding() { @@ -48065,10 +48094,6 @@ export var com; return embedding; } /* Default method injected from com.vzome.core.editor.api.OrbitSource */ - getOrientations$() { - return this.getOrientations(false); - } - /* Default method injected from com.vzome.core.editor.api.OrbitSource */ getOrientations(rowMajor) { if (((typeof rowMajor === 'boolean') || rowMajor === null)) { let __args = arguments; @@ -48116,6 +48141,10 @@ export var com; else throw new Error('invalid overload'); } + /* Default method injected from com.vzome.core.editor.api.OrbitSource */ + getZone(orbit, orientation) { + return this.getSymmetry().getDirection(orbit).getAxis(com.vzome.core.math.symmetry.Symmetry.PLUS, orientation); + } /** * * @return {*} diff --git a/online/src/worker/legacy/resources/com/vzome/core/parts/default/index.js b/online/src/worker/legacy/resources/com/vzome/core/parts/default/index.js index 30dbf43c9..feb9ca4a2 100644 --- a/online/src/worker/legacy/resources/com/vzome/core/parts/default/index.js +++ b/online/src/worker/legacy/resources/com/vzome/core/parts/default/index.js @@ -5,7 +5,9 @@ import connectorUrl from './connector.vef' import blueUrl from './blue.vef' import yellowUrl from './yellow.vef' +import yellowShortUrl from './yellow-short.vef' import redUrl from './red.vef' +import redShortUrl from './red-short.vef' import greenUrl from './green.vef' import snubDiagonalUrl from './snubDiagonal.vef' import blackUrl from './black.vef' @@ -52,6 +54,8 @@ const shapes = { apple: appleUrl, lavender: lavenderUrl, orange: orangeUrl, + 'red-short': redShortUrl, + 'yellow-short': yellowShortUrl, } export default shapes \ No newline at end of file diff --git a/online/src/worker/legacy/resources/com/vzome/core/parts/default/red-short.vef b/online/src/worker/legacy/resources/com/vzome/core/parts/default/red-short.vef new file mode 100644 index 000000000..e042c26da --- /dev/null +++ b/online/src/worker/legacy/resources/com/vzome/core/parts/default/red-short.vef @@ -0,0 +1,39 @@ +vZome VEF 6 field golden + +11 +(0,0) (-1/2,1/2) (-1/2,-1) (0,-1) +(0,0) (-1/2,1/2) (-1/2,0) (-1,1) +(0,0) (1/2,-1) (-1,0) (-1/2,-1/2) +(0,0) (1/2,-1) (0,-1) (-1/2,1/2) +(0,0) (0,0) (-1,-1) (-1,0) +(0,0) (0,0) (-3/2,1/2) (-1/2,0) +(0,0) (0,0) (1/2,-3/2) (-1/2,0) +(0,0) (-1/2,1) (-1,0) (-1/2,-1/2) +(0,0) (-1/2,1) (0,-1) (-1/2,1/2) +(0,0) (1/2,-1/2) (-1/2,-1) (0,-1) +(0,0) (1/2,-1/2) (-1/2,0) (-1,1) + + + +0 + + + +10 +3 0 5 3 +3 1 6 2 +3 2 0 1 +3 3 1 0 +3 5 9 8 +3 6 10 7 +3 7 2 6 +3 8 3 5 +3 9 7 10 +3 10 8 9 + + + +6 +0 2 4 5 7 9 + +tip 4 diff --git a/online/src/worker/legacy/resources/com/vzome/core/parts/default/yellow-short.vef b/online/src/worker/legacy/resources/com/vzome/core/parts/default/yellow-short.vef new file mode 100644 index 000000000..731719933 --- /dev/null +++ b/online/src/worker/legacy/resources/com/vzome/core/parts/default/yellow-short.vef @@ -0,0 +1,32 @@ +vZome VEF 6 field golden + +7 +(0,0) (1/2,0) (0,0) (-1/2,3/2) +(0,0) (0,1) (-1/2,1/2) (-1/2,1) +(0,0) (0,1) (1/2,-1/2) (-1/2,1) +(0,0) (1,0) (-1/2,1/2) (1/2,0) +(0,0) (1,0) (1/2,-1/2) (1/2,0) +(0,0) (1/2,1) (0,0) (1/2,-1/2) +(0,0) (1,1) (0,0) (0,1) + + + +0 + + + +6 +3 1 5 3 +3 3 0 1 +3 3 4 0 +3 4 2 0 +3 5 1 2 +3 5 2 4 + + + +4 +3 4 5 6 + +tip 6 + diff --git a/online/src/worker/legacy/resources/com/vzome/core/parts/lifelike/index.js b/online/src/worker/legacy/resources/com/vzome/core/parts/lifelike/index.js index 68fdcd64e..95421544a 100644 --- a/online/src/worker/legacy/resources/com/vzome/core/parts/lifelike/index.js +++ b/online/src/worker/legacy/resources/com/vzome/core/parts/lifelike/index.js @@ -6,6 +6,8 @@ import connectorUrl from './connector.vef' import blueUrl from './blue.vef' import yellowUrl from './yellow.vef' import redUrl from './red.vef' +import yellowShortUrl from './yellow-short.vef' +import redShortUrl from './red-short.vef' import greenUrl from './green.vef' const shapes = { @@ -14,6 +16,8 @@ const shapes = { yellow: yellowUrl, red: redUrl, green: greenUrl, + 'red-short': redShortUrl, + 'yellow-short': yellowShortUrl, } export default shapes \ No newline at end of file diff --git a/online/src/worker/legacy/resources/com/vzome/core/parts/lifelike/red-short.vef b/online/src/worker/legacy/resources/com/vzome/core/parts/lifelike/red-short.vef new file mode 100644 index 000000000..1d162d26c --- /dev/null +++ b/online/src/worker/legacy/resources/com/vzome/core/parts/lifelike/red-short.vef @@ -0,0 +1,82 @@ +vZome VEF 6 field golden + +31 +(0,0) (-1/2,1/2) (-1/2,-1) (0,-1) +(0,0) (-1/2,1/2) (-1/2,0) (-1,1) +(0,0) (1/2,-1) (-1,-1/2) (-2,2) +(0,0) (1/2,-1) (-8/5,4/5) (-7/10,1/10) +(0,0) (1/2,-1) (-1,0) (-1/2,-1/2) +(0,0) (1/2,-1) (0,-1) (-1/2,1/2) +(0,0) (1/2,-1) (3/5,-9/5) (-3/10,-1/10) +(0,0) (1/2,-1) (0,-1/2) (1,-2) +(0,0) (-1,3/2) (0,-2) (-3/2,1) +(0,0) (-1,3/2) (-3/5,-7/10) (-1/5,-9/10) +(0,0) (-1,3/2) (-2/5,-3/10) (-4/5,9/10) +(0,0) (-1,3/2) (-1,1) (1/2,-1) +(0,0) (0,0) (-1,-1) (-1,0) +(0,0) (0,0) (1/2,-3) (-1,1/2) +(0,0) (0,0) (-3/2,1/2) (-1/2,0) +(0,0) (0,0) (-1/10,-17/10) (3/10,-7/5) +(0,0) (0,0) (-9/10,7/10) (-13/10,7/5) +(0,0) (0,0) (1/2,-3/2) (-1/2,0) +(0,0) (0,0) (-3/2,2) (0,-1/2) +(0,0) (1,-3/2) (0,-2) (-3/2,1) +(0,0) (1,-3/2) (-3/5,-7/10) (-1/5,-9/10) +(0,0) (1,-3/2) (-2/5,-3/10) (-4/5,9/10) +(0,0) (1,-3/2) (-1,1) (1/2,-1) +(0,0) (-1/2,1) (-1,-1/2) (-2,2) +(0,0) (-1/2,1) (-8/5,4/5) (-7/10,1/10) +(0,0) (-1/2,1) (-1,0) (-1/2,-1/2) +(0,0) (-1/2,1) (0,-1) (-1/2,1/2) +(0,0) (-1/2,1) (3/5,-9/5) (-3/10,-1/10) +(0,0) (-1/2,1) (0,-1/2) (1,-2) +(0,0) (1/2,-1/2) (-1/2,-1) (0,-1) +(0,0) (1/2,-1/2) (-1/2,0) (-1,1) + + + +0 + + + +32 +3 0 14 5 +3 1 17 4 +3 4 0 1 +3 5 1 0 +3 14 29 26 +3 17 30 25 +3 25 4 17 +3 26 5 14 +3 29 25 30 +3 30 26 29 +4 2 3 9 8 +4 3 0 4 9 +4 6 1 5 10 +4 6 10 11 7 +4 10 5 26 21 +4 10 21 22 11 +4 15 3 2 13 +4 15 14 0 3 +4 16 17 1 6 +4 16 27 30 17 +4 18 16 6 7 +4 18 28 27 16 +4 20 9 4 25 +4 20 19 8 9 +4 20 24 23 19 +4 20 25 29 24 +4 23 24 15 13 +4 24 29 14 15 +4 26 30 27 21 +4 28 22 21 27 +5 18 7 11 22 28 +5 23 13 2 8 19 + + + +16 +0 2 3 4 8 9 12 13 14 15 +19 20 23 24 25 29 + +tip 12 diff --git a/online/src/worker/legacy/resources/com/vzome/core/parts/lifelike/yellow-short.vef b/online/src/worker/legacy/resources/com/vzome/core/parts/lifelike/yellow-short.vef new file mode 100644 index 000000000..a69c22d9b --- /dev/null +++ b/online/src/worker/legacy/resources/com/vzome/core/parts/lifelike/yellow-short.vef @@ -0,0 +1,60 @@ +vZome VEF 6 field golden + +19 +(0,0) (0,1/2) (0,0) (3/2,-2) +(0,0) (1,-1) (1/2,-1) (1,-3/2) +(0,0) (1,-1) (-1/2,1) (1,-3/2) +(0,0) (1/2,0) (0,0) (-1/2,3/2) +(0,0) (-1/2,5/3) (0,0) (-1/6,5/6) +(0,0) (1/2,1/6) (1/2,-1) (-2/3,4/3) +(0,0) (1/2,1/6) (-1/2,1) (-2/3,4/3) +(0,0) (0,1) (-1/2,1/2) (-1/2,1) +(0,0) (0,1) (1/2,-1/2) (-1/2,1) +(0,0) (1,0) (-1/2,1/2) (1/2,0) +(0,0) (1,0) (1/2,-1/2) (1/2,0) +(0,0) (1/2,5/6) (1/2,-1) (2/3,-1/3) +(0,0) (1/2,5/6) (-1/2,1) (2/3,-1/3) +(0,0) (3/2,-2/3) (0,0) (1/6,1/6) +(0,0) (1/2,1) (0,0) (1/2,-1/2) +(0,0) (0,2) (1/2,-1) (-1,5/2) +(0,0) (0,2) (-1/2,1) (-1,5/2) +(0,0) (1,1/2) (0,0) (-3/2,3) +(0,0) (1,1) (0,0) (0,1) + + + +0 + + + +20 +3 1 0 2 +3 7 14 9 +3 9 3 7 +3 9 10 3 +3 10 8 3 +3 14 7 8 +3 14 8 10 +3 17 16 15 +4 3 8 6 4 +4 4 6 2 0 +4 5 1 2 6 +4 5 4 0 1 +4 5 6 8 7 +4 5 7 3 4 +4 10 9 11 12 +4 10 12 13 14 +4 12 11 15 16 +4 14 13 11 9 +4 17 13 12 16 +4 17 15 11 13 + + + +10 +9 10 11 12 13 14 15 16 17 18 + +tip 18 + + + diff --git a/online/src/worker/legacy/ts/core-java.ts b/online/src/worker/legacy/ts/core-java.ts index 43cd60a9e..a221e476e 100644 --- a/online/src/worker/legacy/ts/core-java.ts +++ b/online/src/worker/legacy/ts/core-java.ts @@ -3589,6 +3589,7 @@ namespace com.vzome.core.render { const orbit: com.vzome.core.math.symmetry.Direction = axis.getDirection(); const len: com.vzome.core.algebra.AlgebraicNumber = axis.getLength(offset); const prototypeLengthShape: com.vzome.core.math.Polyhedron = shapes.getStrutShape(orbit, len); + if (prototypeLengthShape == null)return; this.mShape = prototypeLengthShape; const orn: number = axis.getOrientation(); const orientation: com.vzome.core.algebra.AlgebraicMatrix = shapes.getSymmetry().getMatrix(orn); @@ -4136,8 +4137,8 @@ namespace com.vzome.core.render { export class SymmetryOrbitSource implements com.vzome.core.editor.api.OrbitSource { /* Default method injected from com.vzome.core.editor.api.OrbitSource */ - getZone(orbit: string, orientation: number): com.vzome.core.math.symmetry.Axis { - return this.getSymmetry().getDirection(orbit).getAxis(com.vzome.core.math.symmetry.Symmetry.PLUS, orientation); + getOrientations$(): number[][] { + return this.getOrientations(false); } /* Default method injected from com.vzome.core.editor.api.OrbitSource */ getEmbedding(): number[] { @@ -4159,10 +4160,6 @@ namespace com.vzome.core.render { return embedding; } /* Default method injected from com.vzome.core.editor.api.OrbitSource */ - getOrientations$(): number[][] { - return this.getOrientations(false); - } - /* Default method injected from com.vzome.core.editor.api.OrbitSource */ public getOrientations(rowMajor?: any): number[][] { if (((typeof rowMajor === 'boolean') || rowMajor === null)) { let __args = arguments; @@ -4201,6 +4198,10 @@ namespace com.vzome.core.render { return this.getOrientations$(); } else throw new Error('invalid overload'); } + /* Default method injected from com.vzome.core.editor.api.OrbitSource */ + getZone(orbit: string, orientation: number): com.vzome.core.math.symmetry.Axis { + return this.getSymmetry().getDirection(orbit).getAxis(com.vzome.core.math.symmetry.Symmetry.PLUS, orientation); + } symmetry: com.vzome.core.math.symmetry.Symmetry; orbits: com.vzome.core.math.symmetry.OrbitSet; @@ -4768,6 +4769,8 @@ namespace com.vzome.core.viewing { public halfScaleVertices: java.util.Set; + /*private*/ shortGeometry: com.vzome.core.parts.StrutGeometry; + public constructor(vertices?: any, faces?: any, prototype?: any, fullScaleVertices?: any, halfScaleVertices?: any, field?: any) { if (((vertices != null && (vertices.constructor != null && vertices.constructor["__interfaces"] != null && vertices.constructor["__interfaces"].indexOf("java.util.List") >= 0)) || vertices === null) && ((faces != null && (faces.constructor != null && faces.constructor["__interfaces"] != null && faces.constructor["__interfaces"].indexOf("java.util.List") >= 0)) || faces === null) && ((prototype != null && prototype instanceof com.vzome.core.algebra.AlgebraicVector) || prototype === null) && ((fullScaleVertices != null && (fullScaleVertices.constructor != null && fullScaleVertices.constructor["__interfaces"] != null && fullScaleVertices.constructor["__interfaces"].indexOf("java.util.Set") >= 0)) || fullScaleVertices === null) && ((halfScaleVertices != null && (halfScaleVertices.constructor != null && halfScaleVertices.constructor["__interfaces"] != null && halfScaleVertices.constructor["__interfaces"].indexOf("java.util.Set") >= 0)) || halfScaleVertices === null) && ((field != null && (field.constructor != null && field.constructor["__interfaces"] != null && field.constructor["__interfaces"].indexOf("com.vzome.core.algebra.AlgebraicField") >= 0)) || field === null)) { let __args = arguments; @@ -4777,6 +4780,7 @@ namespace com.vzome.core.viewing { if (this.prototypeVector === undefined) { this.prototypeVector = null; } if (this.fullScaleVertices === undefined) { this.fullScaleVertices = null; } if (this.halfScaleVertices === undefined) { this.halfScaleVertices = null; } + this.shortGeometry = null; this.prototypeVertices = vertices; this.prototypeFaces = faces; this.prototypeVector = prototype; @@ -4795,6 +4799,7 @@ namespace com.vzome.core.viewing { if (this.prototypeVector === undefined) { this.prototypeVector = null; } if (this.fullScaleVertices === undefined) { this.fullScaleVertices = null; } if (this.halfScaleVertices === undefined) { this.halfScaleVertices = null; } + this.shortGeometry = null; this.prototypeVertices = vertices; this.prototypeFaces = faces; this.prototypeVector = prototype; @@ -4816,6 +4821,8 @@ namespace com.vzome.core.viewing { */ public getStrutPolyhedron(length: com.vzome.core.algebra.AlgebraicNumber): com.vzome.core.math.Polyhedron { const tipVertex: com.vzome.core.algebra.AlgebraicVector = this.prototypeVector.scale(length); + let maxNonTipDistance: number = 0; + let minTipDistance: number = tipVertex.toRealVector().length(); const midpoint: com.vzome.core.algebra.AlgebraicVector = tipVertex.scale(this.field['createRational$long$long'](1, 2)); if ((this.field.getName() === ("snubDodec")) && ExportedVEFStrutGeometry.LOGGER_$LI$().isLoggable(java.util.logging.Level.FINE)){ ExportedVEFStrutGeometry.LOGGER_$LI$().fine("proto length = " + this.prototypeVector.toRealVector().length()); @@ -4827,11 +4834,20 @@ namespace com.vzome.core.viewing { let vertex: com.vzome.core.algebra.AlgebraicVector = this.prototypeVertices.get(i); if (this.fullScaleVertices.contains(i)){ vertex = vertex.plus(tipVertex); - } else if (this.halfScaleVertices != null && this.halfScaleVertices.contains(i)){ - vertex = vertex.plus(midpoint); + minTipDistance = Math.min(minTipDistance, vertex.toRealVector().length()); + } else { + if (this.halfScaleVertices != null && this.halfScaleVertices.contains(i)){ + vertex = vertex.plus(midpoint); + } + maxNonTipDistance = Math.max(maxNonTipDistance, vertex.toRealVector().length()); } result.addVertex(vertex); };} + if (maxNonTipDistance > minTipDistance){ + if (this.shortGeometry != null){ + return this.shortGeometry.getStrutPolyhedron(length); + } else return null; + } for(let index=this.prototypeFaces.iterator();index.hasNext();) { let prototypeFace = index.next(); { @@ -4842,6 +4858,10 @@ namespace com.vzome.core.viewing { } return result; } + + public setShortGeometry(shortGeometry: com.vzome.core.parts.StrutGeometry) { + this.shortGeometry = shortGeometry; + } } ExportedVEFStrutGeometry["__class"] = "com.vzome.core.viewing.ExportedVEFStrutGeometry"; ExportedVEFStrutGeometry["__interfaces"] = ["com.vzome.core.parts.StrutGeometry"]; @@ -17038,8 +17058,8 @@ namespace com.vzome.core.editor { namespace com.vzome.core.editor { export class SymmetrySystem implements com.vzome.core.editor.api.OrbitSource { /* Default method injected from com.vzome.core.editor.api.OrbitSource */ - getZone(orbit: string, orientation: number): com.vzome.core.math.symmetry.Axis { - return this.getSymmetry().getDirection(orbit).getAxis(com.vzome.core.math.symmetry.Symmetry.PLUS, orientation); + getOrientations$(): number[][] { + return this.getOrientations(false); } /* Default method injected from com.vzome.core.editor.api.OrbitSource */ getEmbedding(): number[] { @@ -17061,10 +17081,6 @@ namespace com.vzome.core.editor { return embedding; } /* Default method injected from com.vzome.core.editor.api.OrbitSource */ - getOrientations$(): number[][] { - return this.getOrientations(false); - } - /* Default method injected from com.vzome.core.editor.api.OrbitSource */ public getOrientations(rowMajor?: any): number[][] { if (((typeof rowMajor === 'boolean') || rowMajor === null)) { let __args = arguments; @@ -17114,6 +17130,10 @@ namespace com.vzome.core.editor { return this.getOrientations$(); } else throw new Error('invalid overload'); } + /* Default method injected from com.vzome.core.editor.api.OrbitSource */ + getZone(orbit: string, orientation: number): com.vzome.core.math.symmetry.Axis { + return this.getSymmetry().getDirection(orbit).getAxis(com.vzome.core.math.symmetry.Symmetry.PLUS, orientation); + } static logger: java.util.logging.Logger; public static logger_$LI$(): java.util.logging.Logger { if (SymmetrySystem.logger == null) { SymmetrySystem.logger = java.util.logging.Logger.getLogger("com.vzome.core.editor"); } return SymmetrySystem.logger; } /*private*/ nextNewAxis: number; @@ -26848,11 +26868,20 @@ namespace com.vzome.core.viewing { */ createStrutGeometry(dir: com.vzome.core.math.symmetry.Direction): com.vzome.core.parts.StrutGeometry { if (!dir.isAutomatic()){ - const vefData: string = this.loadVefData(dir.getName()); + let shortGeometry: com.vzome.core.parts.StrutGeometry = new com.vzome.core.parts.FastDefaultStrutGeometry(dir); + let vefData: string = this.loadVefData(dir.getName() + "-short"); + if (vefData != null){ + const parser: ExportedVEFShapes.VefToShape = new ExportedVEFShapes.VefToShape(this); + parser.parseVEF(vefData, this.mSymmetry.getField()); + shortGeometry = parser.getStrutGeometry(dir.getAxis$int$int(com.vzome.core.math.symmetry.Symmetry.PLUS, 0).normal()); + } + vefData = this.loadVefData(dir.getName()); if (vefData != null){ const parser: ExportedVEFShapes.VefToShape = new ExportedVEFShapes.VefToShape(this); parser.parseVEF(vefData, this.mSymmetry.getField()); - return parser.getStrutGeometry(dir.getAxis$int$int(com.vzome.core.math.symmetry.Symmetry.PLUS, 0).normal()); + const geometry: com.vzome.core.viewing.ExportedVEFStrutGeometry = parser.getStrutGeometry(dir.getAxis$int$int(com.vzome.core.math.symmetry.Symmetry.PLUS, 0).normal()); + geometry.setShortGeometry(shortGeometry); + return geometry; } const logLevel: java.util.logging.Level = java.util.logging.Level.FINER; if (ExportedVEFShapes.LOGGER_$LI$().isLoggable(logLevel)){ @@ -26915,7 +26944,7 @@ namespace com.vzome.core.viewing { invertSnubBall: boolean; - public getStrutGeometry(prototype: com.vzome.core.algebra.AlgebraicVector): com.vzome.core.parts.StrutGeometry { + public getStrutGeometry(prototype: com.vzome.core.algebra.AlgebraicVector): com.vzome.core.viewing.ExportedVEFStrutGeometry { const tipAxis: com.vzome.core.math.symmetry.Axis = this.__parent.mSymmetry['getAxis$com_vzome_core_algebra_AlgebraicVector'](this.tipVertex); const midpoint: com.vzome.core.algebra.AlgebraicVector = this.tipVertex.scale(this.__parent.mSymmetry.getField()['createRational$long$long'](1, 2)); const orientation: number = this.__parent.mSymmetry.inverse(tipAxis.getOrientation()); @@ -46077,8 +46106,8 @@ namespace com.vzome.core.edits { export class ReplaceWithShape$0 implements com.vzome.core.editor.api.OrbitSource { public __parent: any; /* Default method injected from com.vzome.core.editor.api.OrbitSource */ - getZone(orbit: string, orientation: number): com.vzome.core.math.symmetry.Axis { - return this.getSymmetry().getDirection(orbit).getAxis(com.vzome.core.math.symmetry.Symmetry.PLUS, orientation); + getOrientations$(): number[][] { + return this.getOrientations(false); } /* Default method injected from com.vzome.core.editor.api.OrbitSource */ getEmbedding(): number[] { @@ -46100,10 +46129,6 @@ namespace com.vzome.core.edits { return embedding; } /* Default method injected from com.vzome.core.editor.api.OrbitSource */ - getOrientations$(): number[][] { - return this.getOrientations(false); - } - /* Default method injected from com.vzome.core.editor.api.OrbitSource */ public getOrientations(rowMajor?: any): number[][] { if (((typeof rowMajor === 'boolean') || rowMajor === null)) { let __args = arguments; @@ -46140,6 +46165,10 @@ namespace com.vzome.core.edits { return this.getOrientations$(); } else throw new Error('invalid overload'); } + /* Default method injected from com.vzome.core.editor.api.OrbitSource */ + getZone(orbit: string, orientation: number): com.vzome.core.math.symmetry.Axis { + return this.getSymmetry().getDirection(orbit).getAxis(com.vzome.core.math.symmetry.Symmetry.PLUS, orientation); + } /** * * @return {*}