PShape does not provide getters for rectMode / ellipseMode
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 48/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- java
- Bereich
- computer-graphics
Rechercherichtung
Beginne in der Klasse PShape und untersuche die geschützten Felder ellipseMode und rectMode neben ihrer bestehenden öffentlichen API. Füge eine Möglichkeit hinzu, mit der Aufrufer beide Modi abfragen können, und überprüfe anschließend, dass der Code zur Konvertierung primitiver Formen die Bedeutungen der Parameter für jeden Modus unterscheiden kann.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Most relevant area for this enhancement?
Core/Environment/Rendering
Feature to enhance
The PShape class
Enhancement details
Enhancement description
I was half way developing some classes to convert between PShapes and OPENRNDR Shapes but got stuck.
When dealing with PShape.PRIMITIVE types, PShape.getKind() returns what kind of shape is it (rect, ellipse, ...) and the PShape.getParams() returns an array of float values (x, y, width...) One needs to know the kind to know what the float values mean. But it's not sufficient, because if one called ellipseMode before, the values may mean center x and y, or corner x and y, either width or radius.
I didn't find a way to query ellipseMode or rectMode.
Benefits
Adding a way to query this information would help cross framework use of the PShape data structures.
Challenges
I think adding two getters to PShape shouldn't have any negative impact, but I'm not very familiar with the code base to be sure.
Additional context
Here a wip function where I try to convert an ELLIPSE PShape to an OPENRNDR Shape. This is incomplete, because the meaning of params 0, 1, 2 and 3 depend on the ellipseMode used, and there's no way to figure this out (I think).
PShape.PRIMITIVE -> {
listOf( // 101
when (kind) {
PShape.RECT -> Rectangle( // 30
params[0] * 1.0, params[1] * 1.0,
params[2] * 1.0, params[3] * 1.0
).contour
PShape.ELLIPSE -> Ellipse( // 31
params[0] * 1.0, params[1] * 1.0,
params[2] * 0.5, params[3] * 0.5
).contour
PShape.LINE -> LineSegment(
params[0] * 1.0, params[1] * 1.0,
params[2] * 1.0, params[3] * 1.0
).contour
// ARC, TRIANGLE, QUAD, SPHERE, BOX
else -> error("unsupported primitive kind: $kind")
}
)
PShape holds ellipseMode and rectMode variables, but they are protected and without getters.
Would you like to help implement this enhancement?
I’m not sure yet
- Vorherrschende Sprache
- Java
- Sterne
- 497
- Forks
- 183
- Ø Merge
- 4 Std. 39 Min.
- Gemergte PRs (30 T.)
- 3
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus processing/processing4
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
processing/processing4#1554 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
processing/processing4#1515 · 1 Reaktion ·
-
bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
processing/processing4#1573 ·
-
startup error Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
processing/processing4#1569 · 7 Kommentare ·
-
Binaries under bin directory lack executable permissions for the snap and .deb packages for Linux Offenbug
processing/processing4#1567 · 3 Kommentare · 1 Reaktion · 1 zugewiesene Person ·
Alle Issues in processing/processing4
Ähnliche Issues
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Offenarea/plugin
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
kestra-io/plugin-kestra#190 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
apache/rocketmq-dashboard#5064 ·