api-issue-tracker icon indicating copy to clipboard operation
api-issue-tracker copied to clipboard

Predefined Geometric Helper Constants

Open DanRathbun opened this issue 6 years ago • 3 comments

SketchUp & LayOut C API Parity Feature Request

The Ruby API has predefined Geometric helper objects referenced by constants ...

# Ruby API used for SketchUp models ...
ORIGIN # a Point3d
X_AXIS # a Vector3d
Y_AXIS # a Vector3d
Z_AXIS # a Vector3d
IDENTITY # a (3D) identity transformation

# Ruby API used for LayOut documents ...
ORIGIN_2D # a Point2d
X_AXIS_2D # a Vector2d
Y_AXIS_2D # a Vector2d
IDENTITY_2D # an identity Transformation2d

... these are not yet defined in the C APIs.

// Geometry Constants : "geometry_constants.h"
// Should (in the future) be included by: "geometry.h"

#ifndef GEOMETRY_CONSTANTS_H_
#define GEOMETRY_CONSTANTS_H_

    // SKETCHUP 
    const struct SUPoint3D  SU_ORIGIN = { 0.0, 0.0, 0.0 };
    const struct SUVector3D SU_X_AXIS = { 1.0, 0.0, 0.0 };
    const struct SUVector3D SU_Y_AXIS = { 0.0, 1.0, 0.0 };
    const struct SUVector3D SU_Z_AXIS = { 0.0, 0.0, 1.0 };
    const struct SUTransformation SU_IDENTITY = {
        1.0, 0.0, 0.0, 0.0,
        0.0, 1.0, 0.0, 0.0,
        0.0, 0.0, 1.0, 0.0,
        0.0, 0.0, 0.0, 1.0
    };

    // LAYOUT
    const struct SUPoint2D  LO_ORIGIN = { 0.0, 0.0 };
    const struct SUVector2D LO_X_AXIS = { 1.0, 0.0 };
    const struct SUVector2D LO_Y_AXIS = { 0.0, 1.0 };
    const struct SUTransformation2D LO_IDENTITY = {
        1.0, 0.0, 0.0,
        0.0, 1.0, 0.0
    };

#endif // GEOMETRY_CONSTANTS_H_

DanRathbun avatar Oct 17 '19 07:10 DanRathbun

@thomthom I edited the above example, adding #define include protection so coders can add it as a separate file "geometry_constants.h" to their projects and it can also be later added to the API.

AND ... it's been 4 months and this still hasn't been logged ?

DanRathbun avatar Feb 20 '20 15:02 DanRathbun

Feature requests are treated differently from bug reports. They usually require some more up-front work and investigation. We automate bug reports as they are usually very clear in what course of action and often higher priority since they affected released functionality.

thomthom avatar Mar 19 '20 10:03 thomthom

ping @ackarkka Your thoughts?

DanRathbun avatar Jul 25 '23 16:07 DanRathbun