Repository navigation
refactor(webgl): make Geometry extend GeometryPart - #9321
Srinidhi444 wants to merge 3 commits into
Conversation
|
Hey @davepagurek! Just wanted to share a quick update on the So far, I've:
The relevant geometry tests have been passing. |
davepagurek
left a comment
There was a problem hiding this comment.
Thanks for the updates @Srinidhi444, looking good so far!
One other thing I thought of that I wanted to put on your radar is buildGeometry, since I think that will be affected by this (maybe just the edge handling? not 100% sure yet, I haven't looked at the file again.)
| ); | ||
|
|
||
| expect(geom.hasFillTransparency).toBe( | ||
| p5.GeometryPart.prototype.hasFillTransparency |
There was a problem hiding this comment.
We probably don't need to do this kind of test for every property since ideally just extends GeometryPart does all that. Doesn't hurt to have but in terms of a focus for future tests, it's maybe more productive focusing on behaviour that uses those methods rather than just existence
There was a problem hiding this comment.
Ya that makes sense was just adding them to test locally will remove the existing tests like these in future commits.
|
Thanks for pointing out I've completed the renderer gating changes as well. Previously, Regarding if (this.renderer.states.strokeColor) {
for (const edge of input.edges.map(edge =>
edge.map(idx => idx + startIdx)
)) {
this.geometry.edges.push(edge);
}
}Meanwhile, The stroke pipeline also operates on the aggregate geometry through For now, I'm thinking of preserving the aggregate stroke representation while consolidating the shared geometry functionality. I'd appreciate your feedback on this approach, and please let me know if I've missed anything or misunderstood part of the implementation! |
|
Probably we should be consistent in what gets added where. Ideally everything keeps getting added to the same part, I think, until it hits something that is not able to be in the same part, like a changed texture or material setting. Currently though we don't actually record textures, I think? So possibly we could decide to keep this as-is for now but do everything into a single part, and in the future allow buildGeometry to record multi-part features if they are present? (similar to fill: if you change it while recording we can include it; if it was set before recording we maybe don't need to?) |
Resolves #9313
Changes:
This is a Draft PR for the
Geometry/GeometryPartrefactor discussed with @davepagurek. I'll be implementing and committing the changes incrementally.Completed:
GeometryextendGeometryPart.Planned:
GeometryPart.This cleanup should reduce duplicated geometry logic and provide a cleaner foundation for the UV-related fixes discussed in #9304.
Screenshots of the change:
Not applicable — internal architecture refactor.
PR Checklist
npm run lintpassesTests passed so far:
npx vitest run test/unit/webgl/p5.GeometryPart.jsnpx vitest run test/unit/webgl/p5.Geometry.js