@@ -30,7 +30,7 @@ import {
3030} from "./func-types.js"
3131
3232/** Enum variants for CSG.operation. */
33- export type CSG_Enum_operation = "Subtract " | "Union " | "Intersect "
33+ export type CSG_Enum_operation = "Union " | "Intersect " | "Subtract "
3434
3535/** Optional parameters for the CSG operator. */
3636export interface CSG_Parameters {
@@ -100,7 +100,7 @@ export function GenerateSamplePoints(
100100}
101101
102102/** Enum variants for GradeCellSize.shape_type. */
103- export type GradeCellSize_Enum_shape_type = "Box " | "Ellipsoid " | "Plane " | "Cylinder "
103+ export type GradeCellSize_Enum_shape_type = "Cylinder " | "Box " | "Ellipsoid " | "Plane "
104104
105105/** Optional parameters for the GradeCellSize operator. */
106106export interface GradeCellSize_Parameters {
@@ -193,7 +193,7 @@ export function LoadSamplePoints(
193193}
194194
195195/** Enum variants for LoadVolume.component_type. */
196- export type LoadVolume_Enum_component_type = "Integer " | "Vec2f " | "Vec3i " | "Vec3f" | "Vec4f " | "None " | "Byte " | "Float " | "Vec2i " | "Vec4i "
196+ export type LoadVolume_Enum_component_type = "None " | "Byte " | "Float " | "Vec3f" | "Vec4i " | "Vec4f " | "Integer " | "Vec2i " | "Vec2f " | "Vec3i "
197197
198198/** Optional parameters for the LoadVolume operator. */
199199export interface LoadVolume_Parameters {
@@ -264,7 +264,7 @@ export function Redistance(
264264}
265265
266266/** Enum variants for SampleBeam.node_type. */
267- export type SampleBeam_Enum_node_type = "None " | "Sphere "
267+ export type SampleBeam_Enum_node_type = "Sphere " | "None "
268268
269269/** Enum variants for SampleBeam.section_type. */
270270export type SampleBeam_Enum_section_type = "Circle" | "Cross" | "Box"
@@ -297,7 +297,7 @@ export function SampleBeam(
297297}
298298
299299/** Enum variants for SampleBox.shape_type. */
300- export type SampleBox_Enum_shape_type = "Box " | "Cylinder " | "Torus " | "Link " | "CappedCone " | "Ellipsoid " | "Capsule" | "BoxFrame " | "Plane "
300+ export type SampleBox_Enum_shape_type = "Cylinder " | "BoxFrame " | "Plane " | "Torus " | "Link " | "Box " | "Capsule" | "CappedCone " | "Ellipsoid "
301301
302302/** Optional parameters for the SampleBox operator. */
303303export interface SampleBox_Parameters {
@@ -344,10 +344,10 @@ export function SampleCustomShape(
344344}
345345
346346/** Enum variants for SampleLattice.node_type. */
347- export type SampleLattice_Enum_node_type = "Sphere " | "None "
347+ export type SampleLattice_Enum_node_type = "None " | "Sphere "
348348
349349/** Enum variants for SampleLattice.section_type. */
350- export type SampleLattice_Enum_section_type = "Box " | "Circle " | "Cross "
350+ export type SampleLattice_Enum_section_type = "Circle " | "Cross " | "Box "
351351
352352/** Optional parameters for the SampleLattice operator. */
353353export interface SampleLattice_Parameters {
@@ -381,7 +381,7 @@ export function SampleLattice(
381381}
382382
383383/** Enum variants for SampleSurfaceLattice.lattice_type. */
384- export type SampleSurfaceLattice_Enum_lattice_type = "SchwarzW " | "None " | "SchwarzD " | "I2Y " | "P " | "W " | "PM_Y " | "SchwarzPW " | "S " | "D " | "IWP " | "CP " | "CY " | "C_Y " | "SchwarzN " | "Gyroid " | "CI2Y " | "CD " | "CS " | "Y " | "FRD" | "SD1 " | "F " | "Schwarz " | "CPM_Y "
384+ export type SampleSurfaceLattice_Enum_lattice_type = "CS " | "W " | "Y " | "SchwarzN " | "None " | "D " | "IWP " | "CP " | "SchwarzD " | "CI2Y " | "SchwarzW " | "SchwarzPW " | "C_Y " | "CPM_Y " | "Gyroid " | "I2Y " | "F " | "CY " | "CD " | "PM_Y " | "FRD" | "S " | "SD1 " | "P " | "Schwarz "
385385
386386/** Optional parameters for the SampleSurfaceLattice operator. */
387387export interface SampleSurfaceLattice_Parameters {
@@ -485,14 +485,14 @@ export interface Threshold_Parameters {
485485export function Threshold (
486486 samples : TypedFunc < FuncType . Float > ,
487487 parameters ?: Threshold_Parameters ,
488- ) : TypedFunc < FuncType . Float > {
489- return new TypedFunc < FuncType . Float > (
488+ ) : TypedFunc < FuncType . Byte > {
489+ return new TypedFunc < FuncType . Byte > (
490490 "Threshold" ,
491491 {
492492 "Samples" : samples ,
493493 } ,
494494 parameters ,
495- FuncType . Float ,
495+ FuncType . Byte ,
496496 )
497497}
498498
@@ -562,7 +562,7 @@ export function TransformSphericalCoords(
562562}
563563
564564/** Enum variants for TransformTwistCoords.axis. */
565- export type TransformTwistCoords_Enum_axis = "Z " | "X " | "Y "
565+ export type TransformTwistCoords_Enum_axis = "Y " | "Z " | "X "
566566
567567/** Optional parameters for the TransformTwistCoords operator. */
568568export interface TransformTwistCoords_Parameters {
@@ -592,20 +592,28 @@ export function TransformTwistCoords(
592592 * ----------------------------------------------------------------------------
593593 */
594594
595- /** Helper to generate the SDF for a Box primitive. */
596- export function BoxPrimitive (
595+ /** Helper to generate the SDF for a Cylinder primitive. */
596+ export function CylinderPrimitive (
597597 points : TypedFunc < FuncType . Vec3f > = POINT_SOURCE ,
598598 parameters : Omit < SampleBox_Parameters , "shape_type" > ,
599599) : TypedFunc < FuncType . Float > {
600- return SampleBox ( points , { ...parameters , shape_type : "Box " } )
600+ return SampleBox ( points , { ...parameters , shape_type : "Cylinder " } )
601601}
602602
603- /** Helper to generate the SDF for a Cylinder primitive. */
604- export function CylinderPrimitive (
603+ /** Helper to generate the SDF for a BoxFrame primitive. */
604+ export function BoxFramePrimitive (
605605 points : TypedFunc < FuncType . Vec3f > = POINT_SOURCE ,
606606 parameters : Omit < SampleBox_Parameters , "shape_type" > ,
607607) : TypedFunc < FuncType . Float > {
608- return SampleBox ( points , { ...parameters , shape_type : "Cylinder" } )
608+ return SampleBox ( points , { ...parameters , shape_type : "BoxFrame" } )
609+ }
610+
611+ /** Helper to generate the SDF for a Plane primitive. */
612+ export function PlanePrimitive (
613+ points : TypedFunc < FuncType . Vec3f > = POINT_SOURCE ,
614+ parameters : Omit < SampleBox_Parameters , "shape_type" > ,
615+ ) : TypedFunc < FuncType . Float > {
616+ return SampleBox ( points , { ...parameters , shape_type : "Plane" } )
609617}
610618
611619/** Helper to generate the SDF for a Torus primitive. */
@@ -624,20 +632,12 @@ export function LinkPrimitive(
624632 return SampleBox ( points , { ...parameters , shape_type : "Link" } )
625633}
626634
627- /** Helper to generate the SDF for a CappedCone primitive. */
628- export function CappedConePrimitive (
629- points : TypedFunc < FuncType . Vec3f > = POINT_SOURCE ,
630- parameters : Omit < SampleBox_Parameters , "shape_type" > ,
631- ) : TypedFunc < FuncType . Float > {
632- return SampleBox ( points , { ...parameters , shape_type : "CappedCone" } )
633- }
634-
635- /** Helper to generate the SDF for a Ellipsoid primitive. */
636- export function EllipsoidPrimitive (
635+ /** Helper to generate the SDF for a Box primitive. */
636+ export function BoxPrimitive (
637637 points : TypedFunc < FuncType . Vec3f > = POINT_SOURCE ,
638638 parameters : Omit < SampleBox_Parameters , "shape_type" > ,
639639) : TypedFunc < FuncType . Float > {
640- return SampleBox ( points , { ...parameters , shape_type : "Ellipsoid " } )
640+ return SampleBox ( points , { ...parameters , shape_type : "Box " } )
641641}
642642
643643/** Helper to generate the SDF for a Capsule primitive. */
@@ -648,51 +648,51 @@ export function CapsulePrimitive(
648648 return SampleBox ( points , { ...parameters , shape_type : "Capsule" } )
649649}
650650
651- /** Helper to generate the SDF for a BoxFrame primitive. */
652- export function BoxFramePrimitive (
651+ /** Helper to generate the SDF for a CappedCone primitive. */
652+ export function CappedConePrimitive (
653653 points : TypedFunc < FuncType . Vec3f > = POINT_SOURCE ,
654654 parameters : Omit < SampleBox_Parameters , "shape_type" > ,
655655) : TypedFunc < FuncType . Float > {
656- return SampleBox ( points , { ...parameters , shape_type : "BoxFrame " } )
656+ return SampleBox ( points , { ...parameters , shape_type : "CappedCone " } )
657657}
658658
659- /** Helper to generate the SDF for a Plane primitive. */
660- export function PlanePrimitive (
659+ /** Helper to generate the SDF for a Ellipsoid primitive. */
660+ export function EllipsoidPrimitive (
661661 points : TypedFunc < FuncType . Vec3f > = POINT_SOURCE ,
662662 parameters : Omit < SampleBox_Parameters , "shape_type" > ,
663663) : TypedFunc < FuncType . Float > {
664- return SampleBox ( points , { ...parameters , shape_type : "Plane " } )
664+ return SampleBox ( points , { ...parameters , shape_type : "Ellipsoid " } )
665665}
666666
667- /** Helper to subtract two SDFs. */
668- export function CSGSubtract (
667+ /** Helper to union two SDFs. */
668+ export function CSGUnion (
669669 a : TypedFunc < FuncType . Float > ,
670670 b : TypedFunc < FuncType . Float > ,
671671 smoothing ?: number ,
672672) : TypedFunc < FuncType . Float > {
673- const params : CSG_Parameters = { operation : "Subtract " }
673+ const params : CSG_Parameters = { operation : "Union " }
674674 if ( smoothing ) { params . smoothing = smoothing }
675675 return CSG ( a , b , params )
676676}
677677
678- /** Helper to union two SDFs. */
679- export function CSGUnion (
678+ /** Helper to intersect two SDFs. */
679+ export function CSGIntersect (
680680 a : TypedFunc < FuncType . Float > ,
681681 b : TypedFunc < FuncType . Float > ,
682682 smoothing ?: number ,
683683) : TypedFunc < FuncType . Float > {
684- const params : CSG_Parameters = { operation : "Union " }
684+ const params : CSG_Parameters = { operation : "Intersect " }
685685 if ( smoothing ) { params . smoothing = smoothing }
686686 return CSG ( a , b , params )
687687}
688688
689- /** Helper to intersect two SDFs. */
690- export function CSGIntersect (
689+ /** Helper to subtract two SDFs. */
690+ export function CSGSubtract (
691691 a : TypedFunc < FuncType . Float > ,
692692 b : TypedFunc < FuncType . Float > ,
693693 smoothing ?: number ,
694694) : TypedFunc < FuncType . Float > {
695- const params : CSG_Parameters = { operation : "Intersect " }
695+ const params : CSG_Parameters = { operation : "Subtract " }
696696 if ( smoothing ) { params . smoothing = smoothing }
697697 return CSG ( a , b , params )
698698}
0 commit comments