0.15.0 • Published 4 months ago

redgeometry v0.15.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

redGeometry

2D/3D geometry processing.

Usage

This package provides optimized bundles for CJS and ESM via redgeometry imports, including type declarations and source maps.

import { Vector2, log } from "redgeometry";

const v = new Vector2(1, 2);
log.infoDebug("len = {}", v.len());

Advanced

For certain debugging scenarios it might be useful to import the source files directly with redgeometry/src/* and enable debugging asserts which are not present in the CJS/ESM bundles. However, the consuming application may not be compatible with the sources because of different TypeScript versions and/or configuration. Although direct source imports are mostly supported by the package, they are not recommended for the general use case.

/// <reference types="redgeometry/src/env" />
import { Vector2 } from "redgeometry/src/primitives/vector";
import { log } from "redgeometry/src/utility/debug";

const v = new Vector2(1, 2);
log.infoDebug("len = {}", v.len());

The behavior is controlled by global environment variables, which can be replaced at compile time, e.g. by esbuild with defines:

{
    "define": {
        "REDGEOMETRY_DEBUG": "false"
    }
}

Without identifier replacement, some code will fail with a ReferenceError (variable is not defined). However, the environment variables may also be defined at the top of the main file:

globalThis.REDGEOMETRY_DEBUG = true;
0.13.0

7 months ago

0.14.0

6 months ago

0.13.1

6 months ago

0.15.0

4 months ago

0.14.1

5 months ago

0.14.2

5 months ago

0.12.0

10 months ago

0.11.0

12 months ago

0.10.1

1 year ago

0.10.0

1 year ago

0.9.0

1 year ago

0.8.0

1 year ago

0.7.0

1 year ago

0.6.0

1 year ago

0.5.0

2 years ago

0.3.0

2 years ago

0.4.0

2 years ago

0.3.1

2 years ago

0.2.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago