diff --git a/src/document/brushes.ts b/src/document/brushes.ts index 4eff8433..8ebbe959 100644 --- a/src/document/brushes.ts +++ b/src/document/brushes.ts @@ -207,6 +207,14 @@ export interface RadialPrismBrushGeometry extends BrushGeometry { vertices: Record & Record; } +export interface ConeBrushGeometry extends BrushGeometry { + vertices: Record & Record; +} + +export interface TorusBrushGeometry extends BrushGeometry { + vertices: Record & Record; +} + interface BrushBase { id: string; name?: string; @@ -241,7 +249,29 @@ export interface RadialPrismBrush extends BrushBase { volume: BoxBrushVolumeSettings; } -export type Brush = BoxBrush | WedgeBrush | RadialPrismBrush; +export interface ConeBrush extends BrushBase { + kind: "cone"; + sideCount: number; + geometry: ConeBrushGeometry; + faces: Record & Record; + volume: BoxBrushVolumeSettings; +} + +export interface TorusBrush extends BrushBase { + kind: "torus"; + majorSegmentCount: number; + tubeSegmentCount: number; + geometry: TorusBrushGeometry; + faces: Record & Record; + volume: BoxBrushVolumeSettings; +} + +export type Brush = + | BoxBrush + | WedgeBrush + | RadialPrismBrush + | ConeBrush + | TorusBrush; export const DEFAULT_BOX_BRUSH_CENTER: Vec3 = { x: 0, @@ -261,9 +291,21 @@ export const DEFAULT_BOX_BRUSH_ROTATION_DEGREES: Vec3 = { z: 0 }; +export const DEFAULT_WEDGE_BRUSH_ROTATION_DEGREES: Vec3 = { + x: 0, + y: 0, + z: 180 +}; + export const DEFAULT_BOX_BRUSH_VISIBLE = true; export const DEFAULT_BOX_BRUSH_ENABLED = true; +export const DEFAULT_TORUS_BRUSH_SIZE: Vec3 = { + x: 4, + y: 1, + z: 4 +}; + export const DEFAULT_BOX_BRUSH_WATER_FOAM_CONTACT_LIMIT = 6; export const MAX_BOX_BRUSH_WATER_FOAM_CONTACT_LIMIT = 24; @@ -310,6 +352,14 @@ export function isRadialPrismBrush(brush: Brush): brush is RadialPrismBrush { return brush.kind === "radialPrism"; } +export function isConeBrush(brush: Brush): brush is ConeBrush { + return brush.kind === "cone"; +} + +export function isTorusBrush(brush: Brush): brush is TorusBrush { + return brush.kind === "torus"; +} + function cloneBrushFace(face: BrushFace): BrushFace { return { materialId: face.materialId,