Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update greased_line.md #1204

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ You will find explanation of these options below this code snippet.

```javascript
points: GreasedLinePoints;
pointsOptions?: GreasedLinePointsOptions;
widths?: number[];
widthDistribution?: GreasedLineMeshWidthDistribution;
instance?: GreasedLineMesh;
Expand All @@ -51,6 +52,10 @@ Points of the line specified as x, y, z coordinates. _All the points connected a

If you want to draw only one contiguous line you can use 1D arrays or `Float32Array`. If you want to draw multiple lines you have to use 2D arrays or `Float32Array[]`.

To draw multiple disconnected lines using a flat `Float32Array` you can specify the `pointsOptions.stride` property in the `GreasedLineMeshBuilderOptions` object. This value sets how many entries from the `Float32Array`will be used to create one line. One entry = 3 float values.

<Playground id="#TCURLI#3" title="Float32Array stride" description="How to create disconnected lines using a flat Float32Array." />

```javascript
const points =
[
Expand Down