Skip to content

Predefined Geometric Helper Constants #352

@DanRathbun

Description

@DanRathbun

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_

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions