CadQuery / CadQuery/cadquery

Inconsistent use of length/width in box factories

Aperta
#2,011 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
usability
Lingua principale
Python
Stelle
5.8k
Fork
544
Merge medio
3g 2h
PR unite (30g)
5

Descrizione

Hi,

I'm currently using build123 and CadQuery in parallel for pedagocical purposes and differences in behaviour are quite instructive to identify possible problems.

One issue I noticed is that `cadquery.func.box` treats length/width in the opposite way, but I also noticed this is not consistent in CadQuery inernally:

- In OCCT/OCP, `BRepPrimAPI_MakeBox` takes the arguments `dx, dy, dz`. Obviously, it is completely subjective which of `dx` and `dy` to call length or width.
- `Solid.makeBox` takes `length, width, height` and passes them in this order
- `box` takes `w, l, h` and passes them in this order

I think it's confusing that length and width have opposite meaning in these two functions.

If you consider changing it, I would strongly suggest to actually use `length, width, height` (as opposed to `l, w, h`) in both cases for consistency. Independently of whether anything is changed, I also suggest specifying in the doc string which of those dimensions is in x- and which is in y-direction.

Let me know if I can contribute anything.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Confronta cadquery.func.box e Solid.makeBox con l’ordine degli argomenti documentato di BRepPrimAPI_MakeBox, iniziando dalle rispettive implementazioni e docstring. Decidi come la lunghezza e la larghezza debbano corrispondere alle direzioni x e y, quindi aggiorna in modo coerente la documentazione dell’API e il comportamento interessati. Il lavoro è completato quando entrambe le funzioni usano una semantica delle dimensioni chiaramente documentata e coerente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
computer-graphics
Tipo di issue
Refactoring
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.