@@ -75,6 +75,7 @@ public class ThickenedSurfaceFactory {
75
75
boolean linearHole = false ;
76
76
boolean thickenAlongFaceNormals = false ;
77
77
boolean mergeDuplicateBoundaryVerts = false ;
78
+ boolean constantWidth = false ;
78
79
double holeFactor = 1.0 ;
79
80
double shiftAlongNormal = .5 ;
80
81
int stepsPerEdge = 3 ;
@@ -237,6 +238,13 @@ public boolean isThickenAlongFaceNormals() {
237
238
public void setThickenAlongFaceNormals (boolean thickedAlongFaceNormals ) {
238
239
this .thickenAlongFaceNormals = thickedAlongFaceNormals ;
239
240
}
241
+
242
+ public boolean isConstantWidth () {
243
+ return constantWidth ;
244
+ }
245
+ public void setConstantWidth (boolean constantWidth ) {
246
+ this .constantWidth = constantWidth ;
247
+ }
240
248
241
249
/**
242
250
* This returns the thickened surface. This remains the same for the life of the factory.
@@ -467,12 +475,18 @@ public void update() {
467
475
vb = tangentQuadricBottom [j ]; //Rn.linearCombination(null, 1-t, vb1, t,vb2);
468
476
vt = tangentQuadricTop [j ]; //Rn.linearCombination(null, 1-t, vt1, t,vt2);
469
477
}
470
- // else {
478
+ if (constantWidth ) {
479
+ double [] vl = Rn .linearCombination (null , 1 -u , vb , u , vt );
480
+ double [] cl = Rn .linearCombination (null , 1 -u , cb , u , ct );
481
+ double cc = 1 -v /Rn .euclideanDistance (vl , cl );
482
+ double vc = v /Rn .euclideanDistance (vl , cl );
483
+ Rn .linearCombination (allVertices [allVertCount +vertexCount ], cc , vl , vc , cl );
484
+ } else {
471
485
Rn .bilinearInterpolation (allVertices [allVertCount +vertexCount ], u , v , vb , vt , cb , ct );
472
- allTexCoords [ allVertCount + vertexCount ][ 0 ] = tu ;
473
- allTexCoords [allVertCount +vertexCount ][1 ] = tv ;
474
- nonDuplicateVertexIndicesForThisHole [ vertexCount ] = allVertCount + vertexCount ;
475
- // }
486
+ }
487
+ allTexCoords [allVertCount +vertexCount ][0 ] = tu ;
488
+ allTexCoords [ allVertCount + vertexCount ][ 1 ] = tv ;
489
+ nonDuplicateVertexIndicesForThisHole [ vertexCount ] = allVertCount + vertexCount ;
476
490
vertexCount ++;
477
491
}
478
492
}
0 commit comments