-
Notifications
You must be signed in to change notification settings - Fork 7
Description
First of all, thanks for the fork! Working very well so far.
OpenJSCAD has the concept of synced properties:
The 'property' property of a solid can be used to store metadata for the object, for example the coordinate of a specific point of interest of the solid. Whenever the object is transformed (i.e. rotated, scaled or translated), the properties are transformed with it. So the property will keep pointing to the same point of interest even after several transformations have been applied to the solid.
I think that feature would be really useful to have in some form, since sometimes you want to connect two objects at certain points after they've been transformed multiple times. (I'm actually in that position.)
AFAICS a simple way of implementing it would be adding a Map<String, Vector3d> field in the CSG whose values would be transformed as well, when transformed is called and copied to the new CSG in historySync.
That said, and I could be wrong, it might also be useful to allow this functionality for all Transformable objects (CSG included), so you could transform multiple related objects together without having to union them prematurely.
Transformable could be a marker interface or something like:
public interface Transformable<T> {
T transformed(Transform transform);
}(I don't think it would be a good idea to use the existing properties field, since that would mean that every transform would have to iterate over each key-value and have to check each value for being transformable)