Skip to content

Documentation / @sw-file-lib/geometry / Add2dPolygonOptions

Interface: Add2dPolygonOptions ​

ts
interface Add2dPolygonOptions extends AddFaceOptions {
  readonly color?: ReadonlyColor;
  readonly flip?: boolean;
  readonly materialIndex?: number;
  readonly z?: number;
}

Defined in: builder.ts:117

Options for GeometryBuilder.add2dPolygon.

Extends ​

Properties ​

PropertyModifierTypeDescriptionInherited from

color?

readonly

ReadonlyColor

Vertex color applied to the generated face. (Range: 0-255)

Defaults to white.

AddFaceOptions.color

flip?

readonly

boolean

Whether to reverse the winding order of the generated triangles.

Default

ts
false

AddFaceOptions.flip

materialIndex?

readonly

number

Material index assigned to the generated triangles.

0 = opaque, 1 = glass, 2 = additive. Other values are not supported by Stormworks.

Default

ts
0

AddFaceOptions.materialIndex

z?

readonly

number

Z coordinate of the generated polygon.

Default

ts
0

‐