Questions tagged [csg]

Constructive Solid Geometry

CSG tag should be assigned to questions about the formation of complex solid geometries from primitive solids like cuboids, cylinders, prisms, pyramids, spheres or cones. Sample questions can be: How to handle the operation sequence in a tree structure? How to cut a cuboid with a sphere? How to apply boolean operations inbetween arbitrary geometries?

78 questions
2
votes
1 answer

How to make a mesh manifold

I tried trim_with_solid method to drill a hole into a 3D model: igl::copyleft::cgal::trim_with_solid(m_VA, m_FA, m_VB, m_FB, m_V, m_F, m_D, m_J); But for hollowed 3D models with inner and outer walls, the hole is not closed: Possible solution As…
Megidd
  • 7,089
  • 6
  • 65
  • 142
2
votes
1 answer

Ray casting with CSG tree

I'm working a project in which I have to perform ray casting and use CSG trees. But I don't know how to use the CSG trees or implement it for this project. I can do the ray cast and give the final answer. My problem is really how to implement the…
user812926
  • 21
  • 2
2
votes
1 answer

CSG (THREE.js) » Import local csg.js into another JS-File?

I want to work with THREE.js and especially with CSG, so that I can subtract two obj models from each other using boolean operations. For this purpose I import the respective local files in a central JavaScript file, so that I can work with them in…
Mec-Eng
  • 199
  • 10
2
votes
0 answers

How to create hollow geometries with holes in Three.js (without CSG.js?)

I'd like to create a hollow box with some holes in Three.js. Currently I managed to create a hollow box by creating a regular geometry and pushing triangles by hand (I created the inner box and than the outer box and merged the two together). What I…
OzTamir
  • 131
  • 8
2
votes
3 answers

Constructive Solid Geometry vs Boundary Representation

I want to implement boolean operations on nonconvex polyhedral objects and want to render them with OpenGL. I have read about the two predominant techniques to do boolean operations on polyhedra: Boundary Representation (BReps) and Constructive…
NMO
  • 748
  • 8
  • 16
2
votes
0 answers

JS 2D constructive solid geometry for canvas

Hi I'm writing a part of a web app which creates customised shapes on a 2D canvas and I was wondering how to perform constructive solid geometry using shape coordinates in JS. Are there any pre made libraries I can use for this?
nevernew
  • 650
  • 10
  • 23
2
votes
2 answers

POVray: How to reliably create nice merges of objects merely touching on the surface?

What I'm doing I have a scene which algorithmically draws a prism with a hexagonal cross-section and n layers of such prisms surrounding the center one, such that all the prisms together make a larger hexagon shape. Now, each row of prisms is…
Zet
  • 21
  • 2
1
vote
1 answer

How to create Constructive Solid Geometry in OpenGL / C++

I want to stencil out some objects with openGL. glClear(GL_STENCIL_BUFFER_BIT); glColorMask(false, false, false, false); glEnable(GL_STENCIL_TEST); glStencilFunc(GL_EQUAL, 0, 1); glStencilOp(GL_KEEP, GL_KEEP,…
1
vote
0 answers

How to store face properties for a CGAL Nef_Polyhedra for convex decomposition

I need to use the CGAL convex decomposition algorithm but it seems to only work for a Nef_Polyhedra object. Also, my 3D mesh needs to have face properties (like those provided by the Surface_mesh object, see example). And I'd like to keep the face…
Mildred
  • 463
  • 4
  • 13
1
vote
0 answers

How to go from STEP geometry to CSG

I am trying to transform a solid created in a CAD program (saved in a STEP file) into a CSG object constructed with simple primitives. I am not very familiar with the different geometry file formats but as far as I understand it should be possible…
lobis
  • 145
  • 1
  • 10
1
vote
1 answer

Break solid into constituent parts

The following 3d model-in stl format-is composed of cuboids and cylinders How can I extract the dimensions and coordinates of these constituent solids from the composite, i.e. the dimensions and locations of cuboids/cylinders? I have tried an…
Effective_cellist
  • 1,098
  • 1
  • 19
  • 39
1
vote
1 answer

Why Pymesh boolean operations extremely slow with my simple geometry setup?

I am testing the efficiency of boolean operations in pymesh to see how fast it calculate boolean. But the performance I got using the default engine was extremely slow, comparing to the libigl paper 0.25 s in calculating self-union of 8616…
Shizzy
  • 339
  • 2
  • 4
1
vote
1 answer

intersecting meshes results to mesh with wholes

I am using THREE and I am trying to intersect a box mesh with a custom geometry I am creating and converting it to geometry using : const g = new THREE.Geometry().fromBufferGeometry(shape3d) I aim to add faces to the custom geometry, that is why I…
ThanosSar
  • 532
  • 6
  • 20
1
vote
1 answer

How to use CSGTree for multiple boolean operations

I'm trying to make use of Csg Tree by libigl to do multiple boolean operations at once. In the linked tutorial, there is just this one line: // Compute result of (A ∩ B) \ ((C ∪ D) ∪ E) igl::copyleft::cgal::CSGTree CSGTree = …
Megidd
  • 7,089
  • 6
  • 65
  • 142
1
vote
1 answer

Efficient 2D triangle-triangle subtraction, removing one triangle from another, returning the remainder as triangles

I'm interested in writing a my own function that subtracts one 2D triangle from another, returning the remainder as a n array of triangles. (not using an existing geometry library) Two examples of input & output, triangles are numbered, order isn't…
ideasman42
  • 42,413
  • 44
  • 197
  • 320