@snaptrude/plugin-core 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/entity/index.d.ts +5 -0
- package/dist/api/entity/index.d.ts.map +1 -1
- package/dist/api/entity/referenceLine.d.ts +259 -0
- package/dist/api/entity/referenceLine.d.ts.map +1 -0
- package/dist/api/entity/space.d.ts +252 -5
- package/dist/api/entity/space.d.ts.map +1 -1
- package/dist/api/units/index.d.ts +9 -0
- package/dist/api/units/index.d.ts.map +1 -1
- package/dist/index.cjs +226 -91
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +211 -90
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/api/entity/index.ts +5 -0
- package/src/api/entity/referenceLine.ts +215 -0
- package/src/api/entity/space.ts +231 -8
- package/src/api/units/index.ts +9 -0
- package/tsup.config.ts +0 -1
package/dist/index.js
CHANGED
|
@@ -17,8 +17,8 @@ var PluginVec3Api = class {
|
|
|
17
17
|
* // { x: 1, y: 2, z: 3 }
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
new(x, y,
|
|
21
|
-
return { x, y, z:
|
|
20
|
+
new(x, y, z13) {
|
|
21
|
+
return { x, y, z: z13 };
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Add two vectors component-wise.
|
|
@@ -196,8 +196,8 @@ var PluginQuatApi = class {
|
|
|
196
196
|
* @param w - The W (scalar) component
|
|
197
197
|
* @returns A new {@linkcode PQuat}
|
|
198
198
|
*/
|
|
199
|
-
new(x, y,
|
|
200
|
-
return { x, y, z:
|
|
199
|
+
new(x, y, z13, w) {
|
|
200
|
+
return { x, y, z: z13, w };
|
|
201
201
|
}
|
|
202
202
|
/**
|
|
203
203
|
* Create an identity quaternion representing no rotation.
|
|
@@ -241,13 +241,13 @@ var PluginQuatApi = class {
|
|
|
241
241
|
* @param z - Rotation around Z axis in **radians**
|
|
242
242
|
* @returns A new {@linkcode PQuat}
|
|
243
243
|
*/
|
|
244
|
-
fromEuler(x, y,
|
|
244
|
+
fromEuler(x, y, z13) {
|
|
245
245
|
const cx = Math.cos(x / 2);
|
|
246
246
|
const sx = Math.sin(x / 2);
|
|
247
247
|
const cy = Math.cos(y / 2);
|
|
248
248
|
const sy = Math.sin(y / 2);
|
|
249
|
-
const cz = Math.cos(
|
|
250
|
-
const sz = Math.sin(
|
|
249
|
+
const cz = Math.cos(z13 / 2);
|
|
250
|
+
const sz = Math.sin(z13 / 2);
|
|
251
251
|
return {
|
|
252
252
|
x: sx * cy * cz + cx * sy * sz,
|
|
253
253
|
y: cx * sy * cz - sx * cy * sz,
|
|
@@ -578,73 +578,178 @@ var PluginCoreApi = class {
|
|
|
578
578
|
}
|
|
579
579
|
};
|
|
580
580
|
|
|
581
|
-
// src/api/entity/
|
|
581
|
+
// src/api/entity/referenceLine.ts
|
|
582
582
|
import * as z7 from "zod";
|
|
583
|
+
var PluginReferenceLineApi = class {
|
|
584
|
+
constructor() {
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
var PluginReferenceLineCreateMultiArgs = z7.object({
|
|
588
|
+
profile: PProfile
|
|
589
|
+
});
|
|
590
|
+
var PluginReferenceLineCreateMultiResult = z7.object({
|
|
591
|
+
referenceLineIds: z7.array(z7.string())
|
|
592
|
+
});
|
|
593
|
+
var PluginReferenceLineGetProperty = z7.enum([
|
|
594
|
+
"curve"
|
|
595
|
+
]);
|
|
596
|
+
var PluginReferenceLineGetArgs = z7.object({
|
|
597
|
+
referenceLineId: z7.string(),
|
|
598
|
+
properties: z7.array(PluginReferenceLineGetProperty)
|
|
599
|
+
});
|
|
600
|
+
var PluginReferenceLineGetResult = z7.object({
|
|
601
|
+
curve: PCurve
|
|
602
|
+
}).partial();
|
|
603
|
+
var PluginReferenceLineGetAllResult = z7.object({
|
|
604
|
+
referenceLineIds: z7.array(z7.string())
|
|
605
|
+
});
|
|
606
|
+
var PluginReferenceLineDeleteArgs = z7.object({
|
|
607
|
+
referenceLineId: z7.string()
|
|
608
|
+
});
|
|
609
|
+
|
|
610
|
+
// src/api/entity/space.ts
|
|
611
|
+
import * as z8 from "zod";
|
|
583
612
|
var PluginSpaceApi = class {
|
|
584
613
|
constructor() {
|
|
585
614
|
}
|
|
586
615
|
};
|
|
587
|
-
var PluginSpaceCreateRectangularArgs =
|
|
616
|
+
var PluginSpaceCreateRectangularArgs = z8.object({
|
|
588
617
|
position: PVec3,
|
|
589
|
-
dimensions:
|
|
590
|
-
width:
|
|
591
|
-
height:
|
|
592
|
-
depth:
|
|
618
|
+
dimensions: z8.object({
|
|
619
|
+
width: z8.number(),
|
|
620
|
+
height: z8.number(),
|
|
621
|
+
depth: z8.number()
|
|
593
622
|
})
|
|
594
623
|
});
|
|
595
|
-
var PluginSpaceCreateRectangularResult =
|
|
596
|
-
spaceId:
|
|
624
|
+
var PluginSpaceCreateRectangularResult = z8.object({
|
|
625
|
+
spaceId: z8.string()
|
|
597
626
|
});
|
|
598
|
-
var PluginSpaceCreateFromProfileArgs =
|
|
627
|
+
var PluginSpaceCreateFromProfileArgs = z8.object({
|
|
599
628
|
profile: PProfile,
|
|
600
|
-
extrudeHeight:
|
|
629
|
+
extrudeHeight: z8.number(),
|
|
601
630
|
position: PVec3
|
|
602
631
|
});
|
|
603
|
-
var PluginSpaceCreateFromProfileResult =
|
|
604
|
-
spaceId:
|
|
632
|
+
var PluginSpaceCreateFromProfileResult = z8.object({
|
|
633
|
+
spaceId: z8.string()
|
|
605
634
|
});
|
|
606
|
-
var PluginSpaceGetProperty =
|
|
635
|
+
var PluginSpaceGetProperty = z8.enum([
|
|
636
|
+
// Basic
|
|
607
637
|
"id",
|
|
608
638
|
"type",
|
|
609
639
|
"room_type",
|
|
610
640
|
"name",
|
|
641
|
+
// Derived from parametric data
|
|
611
642
|
"area",
|
|
612
|
-
"
|
|
643
|
+
"breadth",
|
|
644
|
+
"depth",
|
|
645
|
+
"height",
|
|
646
|
+
"massType",
|
|
647
|
+
"spaceType",
|
|
648
|
+
"storey",
|
|
649
|
+
"departmentId",
|
|
650
|
+
"departmentName",
|
|
651
|
+
"departmentColor",
|
|
652
|
+
// Derived from mesh
|
|
613
653
|
"position",
|
|
614
654
|
"absolutePosition",
|
|
615
655
|
"rotation",
|
|
616
|
-
"rotationQuaternion"
|
|
656
|
+
"rotationQuaternion",
|
|
657
|
+
// Derived from brep
|
|
658
|
+
"planPoints"
|
|
659
|
+
]);
|
|
660
|
+
var PluginSpaceGetArgs = z8.object({
|
|
661
|
+
spaceId: z8.string(),
|
|
662
|
+
properties: z8.array(PluginSpaceGetProperty)
|
|
663
|
+
});
|
|
664
|
+
var PluginSpaceType = z8.enum([
|
|
665
|
+
"Room",
|
|
666
|
+
"Program Block",
|
|
667
|
+
"Balcony",
|
|
668
|
+
"Road",
|
|
669
|
+
"Garden",
|
|
670
|
+
"Deck",
|
|
671
|
+
"Pool",
|
|
672
|
+
"Walkway"
|
|
617
673
|
]);
|
|
618
|
-
var
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
674
|
+
var PluginSpaceGetResult = z8.object({
|
|
675
|
+
// Basic
|
|
676
|
+
id: z8.string(),
|
|
677
|
+
type: z8.string(),
|
|
678
|
+
room_type: z8.string(),
|
|
679
|
+
name: z8.string(),
|
|
680
|
+
// Derived from parametric data
|
|
681
|
+
area: z8.number(),
|
|
682
|
+
breadth: z8.number(),
|
|
683
|
+
depth: z8.number(),
|
|
684
|
+
height: z8.number(),
|
|
685
|
+
massType: z8.string().nullable(),
|
|
686
|
+
spaceType: PluginSpaceType.nullable(),
|
|
687
|
+
storey: z8.number().nullable(),
|
|
688
|
+
departmentId: z8.string().nullable(),
|
|
689
|
+
departmentName: z8.string(),
|
|
690
|
+
departmentColor: z8.string(),
|
|
691
|
+
// Derived from mesh
|
|
629
692
|
position: PVec3,
|
|
630
693
|
absolutePosition: PVec3,
|
|
631
694
|
rotation: PVec3,
|
|
632
|
-
rotationQuaternion: PQuat.nullable()
|
|
695
|
+
rotationQuaternion: PQuat.nullable(),
|
|
696
|
+
// Derived from brep
|
|
697
|
+
planPoints: z8.array(PVec3)
|
|
633
698
|
}).partial();
|
|
634
|
-
var PluginSpaceGetAllResult =
|
|
635
|
-
spacesIds:
|
|
699
|
+
var PluginSpaceGetAllResult = z8.object({
|
|
700
|
+
spacesIds: z8.array(z8.string())
|
|
636
701
|
});
|
|
637
|
-
var PluginSpaceDeleteArgs =
|
|
638
|
-
spaceId:
|
|
702
|
+
var PluginSpaceDeleteArgs = z8.object({
|
|
703
|
+
spaceId: z8.string()
|
|
704
|
+
});
|
|
705
|
+
var PluginMassType = z8.enum([
|
|
706
|
+
"Plinth",
|
|
707
|
+
"Void",
|
|
708
|
+
"Pergola",
|
|
709
|
+
"Furniture",
|
|
710
|
+
"Facade element",
|
|
711
|
+
"Generic mass",
|
|
712
|
+
"Room",
|
|
713
|
+
"Department",
|
|
714
|
+
"Building",
|
|
715
|
+
"Revit Import",
|
|
716
|
+
"Mass",
|
|
717
|
+
"Site"
|
|
718
|
+
]);
|
|
719
|
+
var PluginWellKnownDepartmentId = z8.enum([
|
|
720
|
+
"DEFAULT",
|
|
721
|
+
"SITE",
|
|
722
|
+
"ENVELOPE",
|
|
723
|
+
"CORE"
|
|
724
|
+
]);
|
|
725
|
+
var PluginDepartmentId = z8.union([
|
|
726
|
+
PluginWellKnownDepartmentId,
|
|
727
|
+
z8.uuid()
|
|
728
|
+
]);
|
|
729
|
+
var PluginSpaceUpdateArgs = z8.object({
|
|
730
|
+
spaceId: z8.string(),
|
|
731
|
+
properties: z8.object({
|
|
732
|
+
room_type: z8.string().optional(),
|
|
733
|
+
massType: PluginMassType.optional(),
|
|
734
|
+
spaceType: PluginSpaceType.optional(),
|
|
735
|
+
departmentId: PluginDepartmentId.optional()
|
|
736
|
+
})
|
|
737
|
+
});
|
|
738
|
+
var PluginSpaceUpdateResult = z8.object({
|
|
739
|
+
spaceId: z8.string(),
|
|
740
|
+
room_type: z8.string().optional(),
|
|
741
|
+
massType: z8.string().optional(),
|
|
742
|
+
spaceType: z8.string().optional(),
|
|
743
|
+
departmentId: z8.string().nullable().optional()
|
|
639
744
|
});
|
|
640
745
|
|
|
641
746
|
// src/api/entity/story.ts
|
|
642
|
-
import * as
|
|
747
|
+
import * as z9 from "zod";
|
|
643
748
|
var PluginStoryApi = class {
|
|
644
749
|
constructor() {
|
|
645
750
|
}
|
|
646
751
|
};
|
|
647
|
-
var PluginStoryGetProperty =
|
|
752
|
+
var PluginStoryGetProperty = z9.enum([
|
|
648
753
|
"value",
|
|
649
754
|
"id",
|
|
650
755
|
"name",
|
|
@@ -654,44 +759,44 @@ var PluginStoryGetProperty = z8.enum([
|
|
|
654
759
|
"spacesCount",
|
|
655
760
|
"totalArea"
|
|
656
761
|
]);
|
|
657
|
-
var PluginStoryGetArgs =
|
|
658
|
-
storyValue:
|
|
659
|
-
properties:
|
|
762
|
+
var PluginStoryGetArgs = z9.object({
|
|
763
|
+
storyValue: z9.number().int(),
|
|
764
|
+
properties: z9.array(PluginStoryGetProperty)
|
|
660
765
|
});
|
|
661
|
-
var PluginStoryGetResult =
|
|
662
|
-
value:
|
|
663
|
-
id:
|
|
664
|
-
name:
|
|
665
|
-
height:
|
|
666
|
-
base:
|
|
667
|
-
hidden:
|
|
668
|
-
spacesCount:
|
|
669
|
-
totalArea:
|
|
766
|
+
var PluginStoryGetResult = z9.object({
|
|
767
|
+
value: z9.number(),
|
|
768
|
+
id: z9.string(),
|
|
769
|
+
name: z9.string(),
|
|
770
|
+
height: z9.number(),
|
|
771
|
+
base: z9.number(),
|
|
772
|
+
hidden: z9.boolean(),
|
|
773
|
+
spacesCount: z9.number(),
|
|
774
|
+
totalArea: z9.number()
|
|
670
775
|
}).partial();
|
|
671
|
-
var PluginStoryGetAllResult =
|
|
672
|
-
stories:
|
|
673
|
-
|
|
674
|
-
value:
|
|
675
|
-
id:
|
|
676
|
-
name:
|
|
776
|
+
var PluginStoryGetAllResult = z9.object({
|
|
777
|
+
stories: z9.array(
|
|
778
|
+
z9.object({
|
|
779
|
+
value: z9.number(),
|
|
780
|
+
id: z9.string(),
|
|
781
|
+
name: z9.string()
|
|
677
782
|
})
|
|
678
783
|
)
|
|
679
784
|
});
|
|
680
|
-
var PluginStoryCreateArgs =
|
|
681
|
-
storyValue:
|
|
682
|
-
height:
|
|
785
|
+
var PluginStoryCreateArgs = z9.object({
|
|
786
|
+
storyValue: z9.number().int(),
|
|
787
|
+
height: z9.number().optional()
|
|
683
788
|
});
|
|
684
|
-
var PluginStoryCreateResult =
|
|
685
|
-
storyId:
|
|
686
|
-
storyValue:
|
|
789
|
+
var PluginStoryCreateResult = z9.object({
|
|
790
|
+
storyId: z9.string(),
|
|
791
|
+
storyValue: z9.number()
|
|
687
792
|
});
|
|
688
|
-
var PluginStoryUpdateArgs =
|
|
689
|
-
storyValue:
|
|
690
|
-
height:
|
|
793
|
+
var PluginStoryUpdateArgs = z9.object({
|
|
794
|
+
storyValue: z9.number().int(),
|
|
795
|
+
height: z9.number()
|
|
691
796
|
});
|
|
692
|
-
var PluginStoryUpdateResult =
|
|
693
|
-
storyValue:
|
|
694
|
-
height:
|
|
797
|
+
var PluginStoryUpdateResult = z9.object({
|
|
798
|
+
storyValue: z9.number(),
|
|
799
|
+
height: z9.number()
|
|
695
800
|
});
|
|
696
801
|
|
|
697
802
|
// src/api/entity/index.ts
|
|
@@ -701,28 +806,28 @@ var PluginEntityApi = class {
|
|
|
701
806
|
};
|
|
702
807
|
|
|
703
808
|
// src/api/tools/selection.ts
|
|
704
|
-
import * as
|
|
809
|
+
import * as z10 from "zod";
|
|
705
810
|
var PluginSelectionApi = class {
|
|
706
811
|
constructor() {
|
|
707
812
|
}
|
|
708
813
|
};
|
|
709
|
-
var PluginSelectionGetResult =
|
|
710
|
-
selected:
|
|
814
|
+
var PluginSelectionGetResult = z10.object({
|
|
815
|
+
selected: z10.array(z10.string())
|
|
711
816
|
});
|
|
712
817
|
|
|
713
818
|
// src/api/tools/transform.ts
|
|
714
|
-
import * as
|
|
819
|
+
import * as z11 from "zod";
|
|
715
820
|
var PluginTransformApi = class {
|
|
716
821
|
constructor() {
|
|
717
822
|
}
|
|
718
823
|
};
|
|
719
|
-
var PluginMoveArgs =
|
|
720
|
-
componentIds:
|
|
824
|
+
var PluginMoveArgs = z11.object({
|
|
825
|
+
componentIds: z11.array(z11.string()),
|
|
721
826
|
displacement: PVec3
|
|
722
827
|
});
|
|
723
|
-
var PluginRotateArgs =
|
|
724
|
-
componentIds:
|
|
725
|
-
angle:
|
|
828
|
+
var PluginRotateArgs = z11.object({
|
|
829
|
+
componentIds: z11.array(z11.string()),
|
|
830
|
+
angle: z11.number(),
|
|
726
831
|
axis: PVec3,
|
|
727
832
|
pivot: PVec3
|
|
728
833
|
});
|
|
@@ -734,12 +839,12 @@ var PluginToolsApi = class {
|
|
|
734
839
|
};
|
|
735
840
|
|
|
736
841
|
// src/api/units/index.ts
|
|
737
|
-
import * as
|
|
842
|
+
import * as z12 from "zod";
|
|
738
843
|
var PluginUnitsApi = class {
|
|
739
844
|
constructor() {
|
|
740
845
|
}
|
|
741
846
|
};
|
|
742
|
-
var PUnitType =
|
|
847
|
+
var PUnitType = z12.enum([
|
|
743
848
|
"meters",
|
|
744
849
|
"feet-inches",
|
|
745
850
|
"inches",
|
|
@@ -748,19 +853,21 @@ var PUnitType = z11.enum([
|
|
|
748
853
|
"kilometers",
|
|
749
854
|
"miles"
|
|
750
855
|
]);
|
|
751
|
-
var PluginUnitsConvertFromArgs =
|
|
856
|
+
var PluginUnitsConvertFromArgs = z12.object({
|
|
752
857
|
unit: PUnitType,
|
|
753
|
-
value:
|
|
858
|
+
value: z12.number(),
|
|
859
|
+
degree: z12.number().int().min(1).max(3).optional()
|
|
754
860
|
});
|
|
755
|
-
var PluginUnitsConvertFromResult =
|
|
756
|
-
value:
|
|
861
|
+
var PluginUnitsConvertFromResult = z12.object({
|
|
862
|
+
value: z12.number()
|
|
757
863
|
});
|
|
758
|
-
var PluginUnitsConvertToArgs =
|
|
864
|
+
var PluginUnitsConvertToArgs = z12.object({
|
|
759
865
|
unit: PUnitType,
|
|
760
|
-
value:
|
|
866
|
+
value: z12.number(),
|
|
867
|
+
degree: z12.number().int().min(1).max(3).optional()
|
|
761
868
|
});
|
|
762
|
-
var PluginUnitsConvertToResult =
|
|
763
|
-
value:
|
|
869
|
+
var PluginUnitsConvertToResult = z12.object({
|
|
870
|
+
value: z12.number()
|
|
764
871
|
});
|
|
765
872
|
|
|
766
873
|
// src/api/index.ts
|
|
@@ -780,14 +887,24 @@ export {
|
|
|
780
887
|
PluginArcApi,
|
|
781
888
|
PluginCoreApi,
|
|
782
889
|
PluginCurveApi,
|
|
890
|
+
PluginDepartmentId,
|
|
783
891
|
PluginEntityApi,
|
|
784
892
|
PluginGeomApi,
|
|
785
893
|
PluginLineApi,
|
|
894
|
+
PluginMassType,
|
|
786
895
|
PluginMathApi,
|
|
787
896
|
PluginMoveArgs,
|
|
788
897
|
PluginProfileApi,
|
|
789
898
|
PluginProfileFromLinePointsArgs,
|
|
790
899
|
PluginQuatApi,
|
|
900
|
+
PluginReferenceLineApi,
|
|
901
|
+
PluginReferenceLineCreateMultiArgs,
|
|
902
|
+
PluginReferenceLineCreateMultiResult,
|
|
903
|
+
PluginReferenceLineDeleteArgs,
|
|
904
|
+
PluginReferenceLineGetAllResult,
|
|
905
|
+
PluginReferenceLineGetArgs,
|
|
906
|
+
PluginReferenceLineGetProperty,
|
|
907
|
+
PluginReferenceLineGetResult,
|
|
791
908
|
PluginRotateArgs,
|
|
792
909
|
PluginSelectionApi,
|
|
793
910
|
PluginSelectionGetResult,
|
|
@@ -801,6 +918,9 @@ export {
|
|
|
801
918
|
PluginSpaceGetArgs,
|
|
802
919
|
PluginSpaceGetProperty,
|
|
803
920
|
PluginSpaceGetResult,
|
|
921
|
+
PluginSpaceType,
|
|
922
|
+
PluginSpaceUpdateArgs,
|
|
923
|
+
PluginSpaceUpdateResult,
|
|
804
924
|
PluginStoryApi,
|
|
805
925
|
PluginStoryCreateArgs,
|
|
806
926
|
PluginStoryCreateResult,
|
|
@@ -817,6 +937,7 @@ export {
|
|
|
817
937
|
PluginUnitsConvertFromResult,
|
|
818
938
|
PluginUnitsConvertToArgs,
|
|
819
939
|
PluginUnitsConvertToResult,
|
|
820
|
-
PluginVec3Api
|
|
940
|
+
PluginVec3Api,
|
|
941
|
+
PluginWellKnownDepartmentId
|
|
821
942
|
};
|
|
822
943
|
//# sourceMappingURL=index.js.map
|