manifold-3d
    Preparing search index...

    Interface ManifoldToplevel

    interface ManifoldToplevel {
        CrossSection: typeof CrossSection;
        getCircularSegments: (radius: number) => number;
        Manifold: typeof Manifold;
        Mesh: typeof Mesh;
        resetToCircularDefaults: () => void;
        setCircularSegments: (segments: number) => void;
        setMinCircularAngle: (angle: number) => void;
        setMinCircularEdgeLength: (length: number) => void;
        setup: () => void;
        triangulate: (
            polygons: Polygons,
            epsilon?: number,
            allowConvex?: boolean,
        ) => Vec3[];
    }
    Index

    Properties

    CrossSection: typeof CrossSection
    getCircularSegments: (radius: number) => number

    Type declaration

    Manifold: typeof Manifold
    Mesh: typeof Mesh
    resetToCircularDefaults: () => void

    Type declaration

    setCircularSegments: (segments: number) => void

    Type declaration

      • (segments: number): void
      • Sets the default number of circular segments for the CrossSection.circle, Manifold.cylinder, Manifold.sphere, and Manifold.revolve constructors. Overrides the edge length and angle constraints and sets the number of segments to exactly this value.

        Parameters

        • segments: number

          Number of circular segments. Default is 0, meaning no constraint is applied.

        Returns void

    setMinCircularAngle: (angle: number) => void

    Type declaration

      • (angle: number): void
      • Sets an angle constraint the default number of circular segments for the CrossSection.circle, Manifold.cylinder, Manifold.sphere, and Manifold.revolve constructors. The number of segments will be rounded up to the nearest factor of four.

        Parameters

        • angle: number

          The minimum angle in degrees between consecutive segments. The angle will increase if the the segments hit the minimum edge length. Default is 10 degrees.

        Returns void

    setMinCircularEdgeLength: (length: number) => void

    Type declaration

      • (length: number): void
      • Sets a length constraint the default number of circular segments for the CrossSection.circle, Manifold.cylinder, Manifold.sphere, and Manifold.revolve constructors. The number of segments will be rounded up to the nearest factor of four.

        Parameters

        • length: number

          The minimum length of segments. The length will increase if the the segments hit the minimum angle. Default is 1.0.

        Returns void

    setup: () => void
    triangulate: (
        polygons: Polygons,
        epsilon?: number,
        allowConvex?: boolean,
    ) => Vec3[]

    Type declaration

      • (polygons: Polygons, epsilon?: number, allowConvex?: boolean): Vec3[]
      • Triangulates a set of /epsilon-valid polygons.

        Parameters

        • polygons: Polygons

          The set of polygons, wound CCW and representing multiple polygons and/or holes.

        • Optionalepsilon: number

          The value of epsilon, bounding the uncertainty of the input.

        • OptionalallowConvex: boolean

          If true (default), the triangulator will use a fast triangulation if the input is convex, falling back to ear-clipping if not. The triangle quality may be lower, so set to false to disable this optimization.

        Returns Vec3[]

        The triangles, referencing the original polygon points in order.