-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CSG]: consistent abstractions for primitives and colors #291
Comments
It's exciting to hear that CSG may see use in lessons. The way CSG handles colours has gone through a few changes, but it would definitely be feasible to make CSG match rune in terms of usage. That would probably also reduce the amount of work needed to update existing learning materials for rune. After which it would make even more sense to rename CSG's Just leaving a note here that the CSG module summary & sample snippets would also need updating to the new usage. Another note, we could bring back silver as the default colour. See also previous PR comment. |
There may actually be good reasons for the difference between So in order to provide a consistent handling of colors, we would need to limit the functionality of |
Iirc, CSG used to have such functionality in an earlier version. That is, taking in a shape as well as a colour, and returning a new shape entirely in that colour. It should not be too hard to bring back as a feature using JSCAD's |
@Cloud7050 raises the prospect of a color() function for CSG. With that, we could make CSG consistent with runes. How much work would that be? |
Barring unforeseen challenges, I'm thinking some hours to update the existing colours/primitives, add the colour function (probably a few lines), bring back the default colour, and update documentation. This is assuming the JSCAD functions and the current design of CSG doesn't require us to do extra work to ensure colouring the passed shape returns a new shape without mutating the existing shape. There is also interactions with colouring groups to consider. It would then take more hours to do testing and to update the existing samples. In all, maybe 1-2 days of dedicated work for a modules developer with some familiarity. |
The situation in
csg
andrune
is quite similar. We have primitive shapes (including an empty special case) and a way to color things. The two libraries go different routes in this.csg
provides the colors as constants and the primitive shapes as functions that are applied to colors, andrune
provides the primitive shapes as constants and the colors as functions that are applied to shapes.I feel that consistency between the two is more important than which way we go. I would like to replace some
rune
missions/quests withcsg
missions/quests, so consistency across these two modules is particularly important.The text was updated successfully, but these errors were encountered: