CadQuery / CadQuery/cadquery

moving a workplane origin

Offen
#577 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
question
Vorherrschende Sprache
Python
Sterne
5.8k
Forks
544
Ø Merge
3 T. 2 Std.
Gemergte PRs (30 T.)
5

Beschreibung

Hi, I have been using cadquery to produce swept solids. To position the 'end faces' of the solid at specified positions I have been using code similar to this:

`solid = cq.Workplane("XZ").moveTo(50, 0).workplane()`
`solid = solid.polyline([(-10, 10), (10, 10), (10, -10), (-10, -10)]).close()`

Previously, this would create a 20x20 square centered on (50, 0). However, this doesn't work anymore, the square now centers on (0, 0).

Could this be a bug, or maybe this is now the wrong approach to take?

My understanding was that `.moveTo(50, 0).workplane()` would essentially create a new origin at (50, 0) so that the polyline would be placed correctly.

I also notice that if .circle() is used instead of .polyline(), a circle is correctly centered at (50, 0).

Any help with this problem would be greatly appreciated.

Thanks,

John

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne damit, das Problem mit dem bereitgestellten CadQuery-Snippet zu reproduzieren, und vergleiche das Verhalten von moveTo().workplane() gefolgt von polyline() mit dem Fall circle(). Verfolge diese Einstiegspunkte zurück, um festzustellen, warum polyline den verschobenen Ursprung ignoriert. Als erledigt gilt die Aufgabe, wenn das Quadrat wie beschrieben bei (50, 0) zentriert ist und das Verhalten durch einen Regressionstest abgedeckt wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
computer-graphics
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.