'Issues identifying holes in three.js meshes
I'm using the Autodesk Forge Viewer to visualize 2D models created with AutoCAD.
All of them have different layers and I'm trying to detect the topological operations between positive and negative zones (defined in two different layers and created with polylines) with Three.js, so that I can create holes in the zones. The problem is that some of the holes are painted correctly but other ones not.
I've debugged the code and apparently the detection of the holes (with raycast) should work fine and the mesh is created with them (I actualize the property "holes" of the Shape with the Path of the holes, create a ShapeGeometry with her and then create the Mesh with this geometry), but some zones have problems and the function “intersectObjects” can’t find his holes. (The ray is created with the centroid of the negative zone (the hole) and the direction (0,0,-1)).
The point is that if I delete with AutoCAD the other positive and negative zones around the problematic zone, then all the holes of the zone are magically correctly detected and perfectly painted. How can this be possible? Which kind of interference can be causing this problem? All the positive zones are in the same layer and all the negatives in another. Why it seems that there's an interference between the same layer? Is this possible?
See all the zones here, the positive zones are delimited with clear green and the negative with dark green:
As you can see, the holes of the marked zone aren't correctly detected. But if i delete the other zones in AutoCAD, then all the holes are perfectly detected:
Does anyone know why is this happening and how can I solve it? Thank you so much!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
