Open DanRathbun opened 4 years ago
Different answers per type here:
*2D isn't represented in the underlying type. It's rarely used in SketchUp. The usage of 2d types in the C API is mainly relating to LayOut. (And LayOut doesn't use the underlying type of SUTypedValue - it has it's own representation.)
UVQ -SketchUp doesn't have a separate type for this type.
Why SUPoint3d isn't exposed to SUTypedValue, I don't know - that surprised me. This was all implemented early in the C API so I don't know the history. Maybe it was missed by accident, maybe there wasn't a use for it in the API at that time. (I'm not even sure where in the API where a vector is used for SUTypeValue...)
Logged as: SKEXT-3514
Logged as: SKEXT-3515
Just a note here that SketchUp does have screen space coordinates (Point2d
) and 2D bounds (Bounds2d
) which would be helpful when drawing to the view and keeping track of stuff so drawn.
It may be that in the future when Issue 653 : Implement SUViewDraw
is implemented for Live C API use, using the aforementioned types for screen space locating arguments will be helpful.
I just found out that SUTypedValueRef generalize point3d and vector3d and unitvector3d, returning SUTypedValueType_Vector3D
for all these types.
For more details: https://github.com/SketchUp/api-issue-tracker/issues/868
Backstory: What prompted finding out about this was the challenge of how a Ruby extension would pass points and vectors to the Live C API and receive these back from the Live C API.
I already guessed that the passing would likely be done with arrays of 3 doubles. I'm thinking this would be a very good subexample for the Live C API examples repository.
SketchUp C API Question
The
SUTypedValueType
enumeration hasSUTypedValueType_Vector3D
, but not a member for Vector2D, Point2D, Point3D, UVQ, etc.Q: Why not ?