Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 1.29 KB

File metadata and controls

54 lines (36 loc) · 1.29 KB
title OpenGeometry runtime
description Initialize the OpenGeometry WASM module and control runtime behavior

Overview

Before you construct Vector3, kernel-backed primitives, or shapes, initialize OpenGeometry once:

import { OpenGeometry } from "opengeometry";

await OpenGeometry.create({ wasmURL: "/opengeometry_bg.wasm" });

OpenGeometry.create(...) is idempotent. It caches a singleton instance and returns it on subsequent calls.

`Vector3` is wasm-backed in this SDK, so calling `OpenGeometry.create(...)` first is part of the normal runtime contract.

create

await OpenGeometry.create(options);

Options

OpenGeometryOptions:

URL to `opengeometry_bg.wasm`. This must be reachable from the browser or runtime.

Debug mode

You can toggle debug mode after initialization:

const og = await OpenGeometry.create({ wasmURL: "/opengeometry_bg.wasm" });
og.enableDebug = true;

Live demo

Start from the hosted demo index (all demos initialize OpenGeometry): OpenGeometry demos.

Related APIs