From 083c8c32758ab009e336c701460e8bfc7e1262e7 Mon Sep 17 00:00:00 2001 From: John Collins Date: Sun, 10 Mar 2024 15:03:46 -0700 Subject: [PATCH] README --- README.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ad074aa0e..77d29ba44 100644 --- a/README.md +++ b/README.md @@ -22,26 +22,23 @@ import manifold3d.manifold.ExportOptions; public class ManifoldExample { public static void main(String[] args) { - // Create basic shapes Manifold sphere = Manifold.Sphere(10.0f, 20); Manifold cube = Manifold.Cube(new DoubleVec3(15.0f, 15.0f, 15.0f), false); Manifold cylinder = Manifold.Cylinder(3, 30.0f, 30.0f, 0, false) .translateX(20).translateY(20).translateZ(-3.0); // Perform Boolean operations - Manifold diff = cube.subtract(sphere); // Cube minus Sphere - Manifold intersection = cube.intersect(sphere); // Cube intersecting with Sphere - Manifold union = cube.add(sphere); // Cube union with Sphere + Manifold diff = cube.subtract(sphere); + Manifold intersection = cube.intersect(sphere); + Manifold union = cube.add(sphere); - // Export results with options ExportOptions opts = new ExportOptions(); - opts.faceted(false); // Smooth surface + opts.faceted(false); MeshIO.ExportMesh("CubeMinusSphere.stl", diff.getMesh(), opts); MeshIO.ExportMesh("CubeIntersectSphere.glb", intersection.getMesh(), opts); MeshIO.ExportMesh("CubeUnionSphere.obj", union.getMesh(), opts); - // Create a convex hull combining Cube and Cylinder, then translate the Cube Manifold hull = cylinder.convexHull(cube.translateZ(100.0)); MeshIO.ExportMesh("hull.glb", hull.getMesh(), opts); }