Unexpected behaviour when splitting a rotated cylinder #1673
Unanswered
jannisEspelage
asked this question in
Q&A
Replies: 2 comments
-
I reproduced the issue. It appears to be an OCCT kernel issue. import cadquery as cq
r = 9.8
h = 11.6
h_split = 3.265
cyl1 = cq.Solid.makeCylinder(r, h)
cyl1 = cyl1.rotate((0, 0, 0), (0, 1, 0), 8.03)
# invalid shape unless commented out:
cyl1 = cyl1.rotate((0, 0, 0), (1, 0, 0), 8.54e-7)
result = (
cq.Workplane()
.add(cyl1)
.transformed(offset=(0, 0, h_split))
.split(keepTop=True, keepBottom=True)
)
result_1 = result.item(0)
result_2 = result.item(1)
print(result_1.val().isValid())
print(result_2.val().isValid()) or similar result with Free function API: from cadquery.occ_impl.shapes import *
r = 9.8
h = 11.6
h_split = 3.265
cyl1 = cylinder(r * 2, h)
cyl1 = cyl1.rotate((0, 0, 0), (0, 1, 0), 8.03)
# invalid shape unless commented out:
cyl1 = cyl1.rotate((0, 0, 0), (1, 0, 0), 8.54e-7)
tool1 = face(rect(30, 30))
tool1 = tool1.translate((0, 0, h_split))
result = split(cyl1, tool1)
print(result.isValid())
result_1 = result.Solids()[0]
result_2 = result.Solids()[1] Reproduced with OCCT Draw (tested with 7.8.0, 7.8.1): pload MODELING VISUALIZATION
dset r 9.8
dset h 11.6
dset h_split 3.265
pcylinder cyl1 r h
trotate cyl1 0 0 0 0 1 0 8.03
# invalid shape unless commented out:
trotate cyl1 0 0 0 1 0 0 8.54e-7
polyline plane1 0 0 0 30 0 0 30 30 0 0 30 0 0 0 0
mkplane plane1 plane1
ttranslate plane1 -15 -15 h_split
baddobjects cyl1 plane1
bapisplit result
explode result So
puts [vprops result_1]
puts [vprops result_2]
puts [checkshape result_1 -short]
vinit
vdisplay -dispMode 1 result
vfit
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @lorenzncode, thank you for confirming this behaviour! Should this be issued in OCCT so they can fix this? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
i want to split a rotate cylinder (Solid) at a certain height. I do so by adding the cylinder to a Workplane. Then i use the transformed function with the offset argument to create a plane where i want to split the cylinder. However, i experienced an unexpected behaviour. For a certain cylinder and rotations about y and x axis (by ry and rx angles) the split function seems to return the whole cylinder as Top AND Bottom instead of properly splitting it (the splitting plane should intersect the cylinder for this case).
This behaviour can be recreated by the below minimum example which results in the following output on my machine:
Beta Was this translation helpful? Give feedback.
All reactions