Replies: 3 comments 3 replies
-
The shapes also have Location. It looks like this low level code did not consider it. Try without the low level OCCT. import cadquery as cq
a = (
cq.Workplane("YZ")
.moveTo(0, 0)
.lineTo(0, 10)
.lineTo(10, 10)
.lineTo(10, 0)
.close()
.extrude(2, both=True)
)
a = a.workplane(2).pushPoints([(5, 5)]).hole(2)
center_cyl = a.faces("%CYLINDER").val().Center()
edge1 = a.faces("%CYLINDER").edges("%CIRCLE").val()
radius_cyl = edge1.radius()
normal_cyl = edge1.normal() |
Beta Was this translation helpful? Give feedback.
-
Mine was just a minimal example, but how do I find the normal and radius in this case? rod = (
cq.Workplane("XY")
.cylinder(30, 10)
.transformed(rotate=(90, 0, 0))
.pushPoints([(0, 0)])
.cylinder(30, 5, combine='cut')
) Here the edges are not |
Beta Was this translation helpful? Give feedback.
-
This is not an issue anymore, converting to a discussion. |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm implementing some "drilling" for a project of mine and therefore I need to detect holes in parts.
The orientation returned by
face.wrapped.TShape().Surface().Axis().Direction().Coord()
seems to be correct in one case of the cases (c
below) and incorrect in others (a
andb
).In fact, for
c
the direction axis is parallel tox
(correct) while fora
andb
it is parallel toz
(wrong).Why is this so?
Output:
Beta Was this translation helpful? Give feedback.
All reactions