Extrude from face from a tagged workplane

92 views
Skip to first unread message

Laurent Alebarde

unread,
Apr 15, 2023, 8:25:45 AM4/15/23
to CadQuery

This problem is partly discussed in #148 and solved in #351, but I miss something. Here is my code:


`````

import cadquery as cq from math import pi as pi, sin as sin, cos as cos, atan as atan sabot = cq.Workplane("XY" ) \ .ellipseArc(x_radius = 110, y_radius = 110, angle1 = 0, angle2 = 70, sense = -1, startAtCurrent = False) \ .line(30, 0) \ .center(0, 0) \ .ellipseArc(x_radius = 140, y_radius = 140, angle1 = 0, angle2 = 70, sense = 1, startAtCurrent = False) \ .close() \ .extrude(50) \ .faces("<Z").workplane().tag("baseplaneSabot") \ .workplaneFromTagged("baseplaneSabot").transformed(rotate=(5, 0, 0)).split(keepBottom=True).faces(">Z").workplane().tag("PlanSabotDepouille") sabot = sabot.workplaneFromTagged("baseplaneSabot").transformed(rotate=(40, 0, 0)).split(keepTop=True).faces(">Z").workplane().tag("PlanSabotAttaque") sabot = sabot.workplaneFromTagged("baseplaneSabot").transformed(rotate=(40, 0, 0), offset=(0, 0, 40)).split(keepBottom=True) sabot = sabot.workplaneFromTagged("PlanSabotDepouille").faces("<Z").wires().toPending().extrude(1000)
`````

Without the last line, I get:

image
image

With the last line, I want to extrude the blue face whose workplane is tagged "PlanSabotDepouille", but I get the error:
image

Laurent Alebarde

unread,
Apr 15, 2023, 8:34:44 AM4/15/23
to CadQuery
It looks like I cannot edit, here is the code again with LF :

Laurent Alebarde

unread,
Apr 15, 2023, 8:59:56 AM4/15/23
to CadQuery
I could find a workaround with:

```
sabot = sabot.faces("<Z").wires().toPending().extrude(10)
```

instead of the last line:

Capture d’écran_2023-04-15_14-59-26.png

Laurent Alebarde

unread,
Apr 15, 2023, 9:22:06 AM4/15/23
to CadQuery
But now I want to extrude from the side, the face roughly "<Y" (face in green in the folowing figure, expected extrusion wired in green)

Capture d’écran_2023-04-15_15-14-08.png
As a result, it extrudes in the wrong direction. I expect the default direction being normal to the face?

Laurent Alebarde

unread,
Apr 15, 2023, 9:22:53 AM4/15/23
to CadQuery
Forgot the additional code:

```
sabot = sabot.faces("<Z").wires().toPending().extrude(10) \
    .faces("<Y").wires().toPending().extrude(10)
```

Laurent Alebarde

unread,
Apr 15, 2023, 9:26:40 AM4/15/23
to CadQuery
Understood, it kept the previous direction. By casting a new workplane, it sets the new direction:

```
sabot = sabot.faces("<Z").wires().toPending().extrude(10) \
    .faces("<Y").wires().toPending().workplane().extrude(10)
```

Capture d’écran_2023-04-15_15-26-08.png

Reply all
Reply to author
Forward
0 new messages