You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed on the mailing list in May 2012 by David Goodenough, nop head, et al, the rotate_extrude code doesn't seem to work as one would obviously expect with 2d- objects that have 'holes' in them.
A hollow torus in F5 mode
A solid torus in F6 mode
Possible starting point for solution:
hack into src/PolySetCGALEvaluator.cc and do some debugging of the DXF rotation code.
A speculative stab at a possible direction to go if trying to make a fix:
IMHO the issue may be in src/PolySetCGALEvaluator.cc
Right now we have this:
PolySet *PolySetCGALEvaluator::evaluatePolySet(const RotateExtrudeNode &node)
{
. . .
// Before extruding, union all (2D) children nodes
// to a single DxfData, then tesselate this into a PolySet
. . .
}
IE, it 'unions' everything, the holes with the bodies, and then passes it to the rotateDxfData() function.
From pure speculation it would appear that the solution is not so trivial. My first thought would be to try to 'split' the given 2d object into 'holes' and 'solids', and then rotate each of those separately. Then, your final CGAL output object would actually be a combination of 3d Nef Polyhedron objects.
For example, take your hollow donut problem. I think it might be possible to split the two circles into a 'body' circle and a 'hole' circle. This is actually possible using CGAL's 2d geometry code, you can do 'shell iteration' to separate out these components. And in theory, somehow these components can be kept track of in code.
Then, the 'body' circle gets rotated into a 3d CGAL Nef Polyhedron, namely a torus. Then the same is done for the 'hole' circle resulting in a second 3d Nef Poly torus. You then have two 3-dimensional shapes, a larger torus and a smaller torus, the latter inside of the former. The trick is that, since you have stored the 'relationship' between your components, you can then tell CGAL's 3d code to 'subtract' the 'hole' torus from the 'body' torus.
update --- this is basically a way to 'automate' the solution that nop head wrote about on the mailing list.
-DB
The text was updated successfully, but these errors were encountered:
As discussed on the mailing list in May 2012 by David Goodenough, nop head, et al, the rotate_extrude code doesn't seem to work as one would obviously expect with 2d- objects that have 'holes' in them.
Minimal Example
module donut() {
rotate_extrude()
translate([5,0,0])
difference() {
circle(r=2);
circle(r=1);
}
}
difference()
{
donut();
cube([10,10,10]);
}
Expected Result:
A hollow torus in F5 + F6 modes
Actual Result;
A hollow torus in F5 mode
A solid torus in F6 mode
Possible starting point for solution:
hack into src/PolySetCGALEvaluator.cc and do some debugging of the DXF rotation code.
A speculative stab at a possible direction to go if trying to make a fix:
IMHO the issue may be in src/PolySetCGALEvaluator.cc
Right now we have this:
PolySet *PolySetCGALEvaluator::evaluatePolySet(const RotateExtrudeNode &node)
{
. . .
// Before extruding, union all (2D) children nodes
// to a single DxfData, then tesselate this into a PolySet
. . .
}
IE, it 'unions' everything, the holes with the bodies, and then passes it to the rotateDxfData() function.
From pure speculation it would appear that the solution is not so trivial. My first thought would be to try to 'split' the given 2d object into 'holes' and 'solids', and then rotate each of those separately. Then, your final CGAL output object would actually be a combination of 3d Nef Polyhedron objects.
For example, take your hollow donut problem. I think it might be possible to split the two circles into a 'body' circle and a 'hole' circle. This is actually possible using CGAL's 2d geometry code, you can do 'shell iteration' to separate out these components. And in theory, somehow these components can be kept track of in code.
Then, the 'body' circle gets rotated into a 3d CGAL Nef Polyhedron, namely a torus. Then the same is done for the 'hole' circle resulting in a second 3d Nef Poly torus. You then have two 3-dimensional shapes, a larger torus and a smaller torus, the latter inside of the former. The trick is that, since you have stored the 'relationship' between your components, you can then tell CGAL's 3d code to 'subtract' the 'hole' torus from the 'body' torus.
update --- this is basically a way to 'automate' the solution that nop head wrote about on the mailing list.
-DB
The text was updated successfully, but these errors were encountered: