Permalink
Browse files

Fixing HEM_Extrude bug

  • Loading branch information...
wblut committed Nov 5, 2017
1 parent 68c6446 commit 4a71e7c9e0184dc7b68a0af12c8c88ce5c246354
Showing with 1,626 additions and 1,848 deletions.
  1. +1 −1 README.md
  2. +734 −734 examples/core/Ref_WB_ProgressReporter/log.txt
  3. +12 −14 examples/geom/bounding/Ref_WB_AABBTree2D/Ref_WB_AABBTree2D.pde
  4. +1 −1 examples/geom/bounding/Ref_WB_IndexedAABBTree2D/Ref_WB_IndexedAABBTree2D.pde
  5. +6 −8 examples/geom/create/Ref_WB_Danzer/Ref_WB_Danzer.pde
  6. +2 −2 examples/geom/create/polygon/Ref_WB_PyramidFactory/Ref_WB_PyramidFactory.pde
  7. +4 −4 examples/geom/isosurface/Ref_WB_IsoSurface2D/Ref_WB_IsoSurface2D.pde
  8. +1 −1 ...triangulate/Ref_WB_Triangulation2D_Conforming_Points/Ref_WB_Triangulation2D_Conforming_Points.pde
  9. +1 −1 ...iangulate/Ref_WB_Triangulation2D_Conforming_Polygon/Ref_WB_Triangulation2D_Conforming_Polygon.pde
  10. +0 −1 examples/geom/voronoi/Ref_WB_Voronoi_2_5D/Ref_WB_Voronoi_2_5D.pde
  11. +1 −1 examples/hemesh/create/Ref_HEC_Ellipsoid/Ref_HEC_Ellipsoid.pde
  12. +2 −2 examples/hemesh/create/Ref_HEC_IsoSurfaceFunction/Ref_HEC_IsoSurfaceFunction.pde
  13. +9 −8 examples/hemesh/modify/Ref_HEM_Extrude/Ref_HEM_Extrude.pde
  14. +0 −66 examples/hemesh/modify/Ref_HEM_FlatExtrude/Ref_HEM_FlatExtrude.pde
  15. +1 −4 examples/hemesh/modify/Ref_HEM_Lattice_Selection/Ref_HEM_Lattice_Selection.pde
  16. +2 −2 examples/hemesh/modify/Ref_HEM_SliceSurface_Selection/Ref_HEM_SliceSurface_Selection.pde
  17. +6 −4 examples/math/Ref_WB_Noise/Ref_WB_Noise.pde
  18. +1 −1 examples/spielerei/VoronoiOnSphere/VoronoiOnSphere.pde
  19. +0 −82 src/core/wblut/core/WB_ProgressCounter.java
  20. +399 −0 src/core/wblut/core/WB_ProgressReporter.java
  21. +0 −137 src/core/wblut/core/WB_ProgressStatus.java
  22. +0 −194 src/core/wblut/core/WB_ProgressTracker.java
  23. +1 −1 src/core/wblut/core/WB_Version.java
  24. +1 −1 src/geom/wblut/geom/WB_AABBTree.java
  25. +25 −1 src/geom/wblut/geom/WB_AABBTree2D.java
  26. +6 −5 src/geom/wblut/geom/WB_AlphaTriangulation2D.java
  27. +13 −11 src/geom/wblut/geom/WB_CoordCollection.java
  28. +14 −7 src/geom/wblut/geom/WB_Danzer.java
  29. +6 −1 src/geom/wblut/geom/WB_GeometryFactory2D.java
  30. +1 −1 src/geom/wblut/geom/WB_GeometryOp2D.java
  31. +4 −3 src/geom/wblut/geom/WB_IndexedAABBTree2D.java
  32. +2 −4 src/geom/wblut/geom/WB_IndexedTriangle.java
  33. +0 −1 src/geom/wblut/geom/WB_IsoValues2D.java
  34. +58 −3 src/geom/wblut/geom/WB_Mesh.java
  35. +3 −3 src/geom/wblut/geom/WB_PolyLine.java
  36. +21 −1 src/geom/wblut/geom/WB_Polygon.java
  37. +23 −18 src/geom/wblut/geom/WB_PolygonDecomposer.java
  38. +5 −4 src/geom/wblut/geom/WB_PolygonSplitter.java
  39. +7 −5 src/geom/wblut/geom/WB_PolygonTriangulatorJTS.java
  40. +1 −1 src/geom/wblut/geom/WB_TriangleMesh.java
  41. +6 −4 src/geom/wblut/geom/WB_Triangulate2D.java
  42. +36 −8 src/geom/wblut/geom/WB_Triangulation2DWithPoints.java
  43. +17 −2 src/hemesh_core/wblut/hemesh/HE_Face.java
  44. +2 −2 src/hemesh_core/wblut/hemesh/HE_Machine.java
  45. +36 −16 src/hemesh_core/wblut/hemesh/HE_Mesh.java
  46. +1 −1 src/hemesh_core/wblut/hemesh/HE_MeshElement.java
  47. +1 −1 src/hemesh_core/wblut/hemesh/HE_MeshStructure.java
  48. +1 −1 src/hemesh_creators/wblut/hemesh/HEC_Copy.java
  49. +7 −0 src/hemesh_creators/wblut/hemesh/HEC_FromFacelist.java
  50. +9 −9 src/hemesh_creators/wblut/hemesh/HEC_FromTriangulation.java
  51. +1 −1 src/hemesh_creators/wblut/hemesh/HEMC_VoronoiBox.java
  52. +1 −1 src/hemesh_modifiers/wblut/hemesh/HEM_CapHoles.java
  53. +1 −1 src/hemesh_modifiers/wblut/hemesh/HEM_Crocodile.java
  54. +40 −49 src/hemesh_modifiers/wblut/hemesh/HEM_Extrude.java
  55. +0 −388 src/hemesh_modifiers/wblut/hemesh/HEM_FlatExtrude.java
  56. +1 −1 src/hemesh_modifiers/wblut/hemesh/HEM_FlipFaces.java
  57. +1 −1 src/hemesh_modifiers/wblut/hemesh/HEM_Lattice.java
  58. +1 −1 src/hemesh_modifiers/wblut/hemesh/HEM_MeanCurvatureSmooth.java
  59. +1 −1 src/hemesh_modifiers/wblut/hemesh/HEM_Slice.java
  60. +1 −1 src/hemesh_modifiers/wblut/hemesh/HEM_SliceEdges.java
  61. +1 −1 src/hemesh_modifiers/wblut/hemesh/HEM_SliceSurface.java
  62. +1 −1 src/hemesh_modifiers/wblut/hemesh/HEM_Smooth.java
  63. +1 −1 src/hemesh_modifiers/wblut/hemesh/HEM_TangentialSmooth.java
  64. +1 −1 src/hemesh_modifiers/wblut/hemesh/HEM_TaubinSmooth.java
  65. +1 −1 src/hemesh_modifiers/wblut/hemesh/HEM_TriSplit.java
  66. +1 −1 src/hemesh_modifiers/wblut/hemesh/HEM_Triangulate.java
  67. +1 −1 src/hemesh_modifiers/wblut/hemesh/HEM_TriangulateMT.java
  68. +1 −1 src/hemesh_subdividors/wblut/hemesh/HES_CatmullClark.java
  69. +1 −1 src/hemesh_subdividors/wblut/hemesh/HES_QuadSplit.java
  70. +1 −1 src/hemesh_subdividors/wblut/hemesh/HES_TriDec.java
  71. +1 −1 src/hemesh_subdividors/wblut/hemesh/HES_TriDecLimit.java
  72. +2 −2 src/hemesh_tools/wblut/hemesh/HET_Fixer.java
  73. +2 −2 src/hemesh_tools/wblut/hemesh/HET_MeshOp.java
  74. +2 −2 src/hemesh_tools/wblut/hemesh/HET_PlanarPathTriangulator.java
  75. +1 −0 src/math/wblut/math/WB_ScalarParameter.java
  76. +3 −2 src/processing/wblut/processing/WB_PShapeFactory.java
  77. +26 −0 src/processing/wblut/processing/WB_Render2D.java
  78. +41 −1 src/processing/wblut/processing/WB_Render3D.java
View
@@ -33,7 +33,7 @@ The following classes are subject to the license agreement of their original aut
* wblut.geom.WB_PolygonSplitter
* wblut.geom.WB_ShapeReader
* wblut.hemesh.HEC_SuperDuper
* wblut.geom.HET_FaceSplitter
* wblut.hemesh.HET_FaceSplitter
* wblut.math.WB_DoubleDouble
* wblut.math.WB_Ease
* wblut.math.WB_MTRandom

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -6,9 +6,10 @@ import wblut.nurbs.*;
import wblut.processing.*;
WB_Render3D render;
ArrayList<WB_Triangle> tris;
int[] tris;
WB_CoordCollection points;
WB_AABBTree2D tree;
WB_Danzer danzerC;
void setup() {
size(1000, 1000, P3D);
smooth(8);
@@ -17,27 +18,24 @@ void setup() {
render=new WB_Render3D(this);
println(WB_Version.version());
println(WB_Disclaimer.disclaimer());
WB_Danzer danzerC=new WB_Danzer(800.0, WB_Danzer.Type.C,new WB_Point(width/2,height/2));
danzerC=new WB_Danzer(800.0, WB_Danzer.Type.C, new WB_Point(width/2, height/2));
danzerC.inflate(3);
tris=new ArrayList<WB_Triangle>();
tris.addAll(danzerC.getTriangles());
tree=new WB_AABBTree2D(tris,1);
points=danzerC.getPoints();
tris=danzerC.getTriangles();
tree=new WB_AABBTree2D(tris, points, 1);
}
void draw() {
background(55);
noFill();
strokeWeight(1.0);
stroke(255,0,0,40);
stroke(255, 0, 0, 40);
render.drawAABBTree2D(tree);
strokeWeight(1.4);
stroke(0);
for (WB_Triangle tri : tris) {
render.drawTriangle2D(tri);
}
WB_Triangle closest=tree.getClosestFace(new WB_Point(mouseX,mouseY));
fill(255,0,0);
render.drawTriangle2D(danzerC);
WB_Triangle closest=tree.getClosestFace(new WB_Point(mouseX, mouseY));
fill(255, 0, 0);
render.drawTriangle2D(closest);
}
@@ -26,7 +26,7 @@ void setup() {
points.add(source.nextPoint());
}
triangulation=WB_Triangulate.triangulate2D(points);
tree=new WB_IndexedAABBTree2D(triangulation,points,1);
tree=new WB_IndexedAABBTree2D(triangulation, WB_CoordCollection.getCollection(points),1);
}
void draw() {
@@ -8,7 +8,7 @@ import wblut.processing.*;
WB_Render3D render;
WB_Danzer danzerA, danzerB, danzerC;
ArrayList<WB_Polygon> polys;
float scale;
void setup() {
@@ -26,17 +26,15 @@ void setup() {
danzerB.inflate(3);
danzerC=new WB_Danzer(scale, WB_Danzer.Type.C,new WB_Point(250,0,0));
danzerC.inflate(3);
polys=new ArrayList<WB_Polygon>();
polys.addAll(danzerA.getTiles());
polys.addAll(danzerB.getTiles());
polys.addAll(danzerC.getTiles());
}
void draw() {
background(55);
translate(width/2, height/2);
stroke(0);
for (WB_Polygon poly : polys) {
render.drawPolygon(poly);
}
render.drawTriangle2D(danzerA);
render.drawTriangle2D(danzerB);
render.drawTriangle2D(danzerC);
}
@@ -15,7 +15,7 @@ void setup() {
size(1000, 1000, P3D);
smooth(8);
render=new WB_Render3D(this);
create(50);
create(250);
background(55);
noCursor();
}
@@ -39,7 +39,7 @@ void draw() {
}
void mousePressed() {
create(50);
create(250);
}
void create(float h) {
@@ -10,19 +10,19 @@ List<WB_Segment> segments;
void setup() {
fullScreen(P3D);
smooth(8);
noiseDetail(8);
float[][] values=new float[81][51];
for (int i = 0; i < 81; i++) {
for (int j = 0; j < 51; j++) {
values[i][j]=2.5*sin(radians(12*i))*cos(radians(15*j));
values[i][j]= 2.5*sin(i)*cos(j)+4*noise(0.2*i,0.2*j);
}
}
WB_IsoSurface2D creator=new WB_IsoSurface2D();
creator.setSize(12, 12);
creator.setValues(values);
creator.setIsolevel(0.2);
creator.setBoundary(-200);// value outside grid
creator.setIsolevel(0.5);
creator.setBoundary(200);// value outside grid
// use creator.clearBoundary() to rest boundary values to "no value".
//Gamma controls level of grid snap, 0.0-0.5. Can improve the
@@ -8,7 +8,7 @@ WB_GeometryFactory gf=new WB_GeometryFactory();
WB_Render2D render;
WB_Triangulation2DWithPoints confTri;
List<WB_Coord> points;
List<WB_Coord> pointsAfterTriangulation;
WB_CoordCollection pointsAfterTriangulation;
int[] triangles;
void setup() {
@@ -18,7 +18,7 @@ ArrayList<WB_Point>[] holes;
WB_Polygon polygon;
int[] triangles;
ArrayList<WB_Point> points;
List<WB_Coord> pointsAfterTriangulation;
WB_CoordCollection pointsAfterTriangulation;
void setup() {
size(800, 800);
smooth(8);
@@ -42,7 +42,6 @@ void draw() {
text("click",0,350);
rotateY(mouseX*1.0f/width*TWO_PI);
rotateX(mouseY*1.0f/height*TWO_PI);
translate(0, 0, -200);
noFill();
stroke(0);
strokeWeight(2);
@@ -37,7 +37,7 @@ void draw() {
stroke(255,0,0);
while(vItr.hasNext()){
v=vItr.next();
WB_Coord n=v.getVertexNormalMeanCurvature();
WB_Coord n=v.getVertexNormal();
render.drawVector(v,n,50.0);
}
@@ -14,7 +14,7 @@ void setup() {
HEC_IsoSurface creator=new HEC_IsoSurface();
creator.setResolution(128, 64,64);
creator.setResolution(64, 64,64);
creator.setSize(8, 8,8);
//3D grids of values can take up a lot of memory, using a function
//can decrease the memory use, allow larger grids. The resulting number
@@ -48,6 +48,6 @@ void draw() {
class ScalarField implements WB_ScalarParameter{
double evaluate(double... x){
return noise(0.35*(float)(x[0]-6.4),0.35*(float)(x[1]-3.2),0.35*(float)(x[2]-3.2));
return noise(0.35*(float)(x[0]-3.2),0.35*(float)(x[1]-3.2),0.35*(float)(x[2]-3.2));
}
}
@@ -18,10 +18,9 @@ void setup() {
modifier.setDistance(0);// extrusion distance, set to 0 for inset faces
modifier.setRelative(false);// treat chamfer as relative to face size or as absolute value
modifier.setChamfer(10);// chamfer for non-hard edges
modifier.setHardEdgeChamfer(200);// chamfer for hard edges
modifier.setThresholdAngle(1.5*HALF_PI);// treat edges sharper than this angle as hard edges
modifier.setHardEdgeChamfer(80);// chamfer for hard edges
modifier.setThresholdAngle(Math.PI*0.5);// treat edges sharper than this angle as hard edges
modifier.setFuse(true);// try to fuse planar adjacent planar faces created by the extrude
modifier.setFuseAngle(0.05*HALF_PI);// threshold angle to be considered coplanar
modifier.setPeak(true);//if absolute chamfer is too large for face, create a peak on the face
mesh.modify(modifier);
@@ -38,6 +37,7 @@ void draw() {
fill(255);
noStroke();
render.drawFacesWithInternalLabel(1, mesh);//HEM_Extrude sets all extruded faces to label 1
fill(255, 0, 0);
render.drawFacesWithInternalLabel(2, mesh);//HEM_Extrude sets all "wall" faces to label 2
fill(250, 120, 120);
@@ -46,12 +46,13 @@ void draw() {
render.drawFacesWithInternalLabel(4, mesh);//HEM_Extrude sets all peaked faces to label 4
stroke(0);
render.drawEdges(mesh);
createMesh();
float d=sin(TWO_PI*0.01*frameCount)*30;
if (abs(d)<15) d=0;
modifier.setDistance(d);
mesh.modify(modifier);
float d=sin(TWO_PI*0.01*frameCount)*30;
if (abs(d)<15) d=0;
modifier.setDistance(d);
mesh.modify(modifier);
}

This file was deleted.

Oops, something went wrong.
@@ -4,15 +4,12 @@ import wblut.core.*;
import wblut.hemesh.*;
import wblut.geom.*;
HE_Mesh mesh;
WB_Render render;
WB_ProgressReporter pr;
void setup() {
size(1000,1000,P3D);
smooth(8);
pr=new WB_ProgressReporter(3);
pr.start();
createMesh();
// Tries to create a mesh lattice by insetting all faces,making an expanded copy and
// then connect the inset faces...
@@ -37,13 +37,13 @@ void draw() {
render.drawFaces(mesh);
fill(255, 0, 0);
noStroke();
render.drawFaces(modifier.cutFaces);
render.drawFaces(mesh.getSelection("cuts"));
noFill();
stroke(0);
render.drawEdges(mesh);
strokeWeight(4);
stroke(0, 0, 255);
render.drawEdges(modifier.newEdges);
render.drawEdges(mesh.getSelection("edges"));
strokeWeight(1);
stroke(255, 0, 0);
render.drawPlane(P, 300);
@@ -10,26 +10,28 @@ void setup() {
//Perlin Noise, implementation from Processing core
n1=new WB_PNoise().setDetail(8,0.5);
n1.setScale(0.005);
n1.setScale(0.01);
//Simplex noise
n2=new WB_SNoise();
n2.setScale(0.01);
//Open simplex noise
n3=new WB_OSNoise();
n3.setScale(0.02);
n3.setScale(0.01);
}
void draw() {
background(55);
stroke(0);
strokeWeight(2);
stroke(255,0,0);
for (int i=0; i<width; i++) {
point(i, 200-100*(float)n1.value1D(i+frameCount));
point(i, 400-100*(float)n2.value1D(i+frameCount));
point(i, 600-100*(float)n3.value1D(i+frameCount));
}
stroke(255, 0, 0);
strokeWeight(1);
stroke(0);
line(0, 200, width, 200);
line(0, 400, width, 400);
line(0, 600, width, 600);
@@ -32,7 +32,7 @@ void setup() {
mesh=new HE_Mesh(new HEC_Dual(mesh).setFixNonPlanarFaces(false));
HEM_Extrude ext=new HEM_Extrude().setDistance(0).setChamfer(5).setRelative(false);
mesh.modify(ext);
ext.extruded.modify(new HEM_Extrude().setDistance(-20));
mesh.getSelection("extruded").modify(new HEM_Extrude().setDistance(-20));
render=new WB_Render3D(this);
}
Oops, something went wrong.

0 comments on commit 4a71e7c

Please sign in to comment.