door_models 0.1.1 → 2.0.0

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.
@@ -0,0 +1,20 @@
1
+ import * as THREE from "three";
2
+ export declare const availableMaterials: {
3
+ black: THREE.MeshStandardMaterial;
4
+ metal: THREE.MeshStandardMaterial;
5
+ darkgrey: THREE.MeshStandardMaterial;
6
+ grey: THREE.MeshStandardMaterial;
7
+ yellow: THREE.MeshStandardMaterial;
8
+ darkBrown: THREE.MeshStandardMaterial;
9
+ brown: THREE.MeshStandardMaterial;
10
+ glass: THREE.MeshStandardMaterial;
11
+ aluminum: THREE.MeshStandardMaterial;
12
+ silver: THREE.MeshStandardMaterial;
13
+ gold: THREE.MeshStandardMaterial;
14
+ diamond: THREE.MeshStandardMaterial;
15
+ };
16
+ type DoorModelsProps = {
17
+ doorName?: string;
18
+ };
19
+ declare function DoorModels({ doorName }: DoorModelsProps): import("react/jsx-runtime").JSX.Element;
20
+ export default DoorModels;
@@ -8,63 +8,63 @@ var _react = _interopRequireWildcard(require("react"));
8
8
  var _csg = require("@react-three/csg");
9
9
  var _DoorContext = require("../context/DoorContext");
10
10
  var _three = require("@react-spring/three");
11
- var THREE = _interopRequireWildcard(require("three"));
11
+ var _three2 = require("three");
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
13
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
14
- const placeholderMaterial = new THREE.MeshStandardMaterial({
14
+ const placeholderMaterial = new _three2.MeshStandardMaterial({
15
15
  color: "#cccccc",
16
16
  roughness: 0.8
17
17
  });
18
- const placeholderMaterialforFrames = new THREE.MeshStandardMaterial({
18
+ const placeholderMaterialforFrames = new _three2.MeshStandardMaterial({
19
19
  color: "#000",
20
20
  roughness: 0.8
21
21
  });
22
22
  const availableMaterials = exports.availableMaterials = {
23
- black: new THREE.MeshStandardMaterial({
23
+ black: new _three2.MeshStandardMaterial({
24
24
  color: "#000000"
25
25
  }),
26
- metal: new THREE.MeshStandardMaterial({
26
+ metal: new _three2.MeshStandardMaterial({
27
27
  color: "#0xaaaaaa",
28
28
  metalness: 1.0,
29
29
  roughness: 0.4
30
30
  }),
31
- darkgrey: new THREE.MeshStandardMaterial({
31
+ darkgrey: new _three2.MeshStandardMaterial({
32
32
  color: "#5e5e5e"
33
33
  }),
34
- grey: new THREE.MeshStandardMaterial({
34
+ grey: new _three2.MeshStandardMaterial({
35
35
  color: "#cccccc"
36
36
  }),
37
- yellow: new THREE.MeshStandardMaterial({
37
+ yellow: new _three2.MeshStandardMaterial({
38
38
  color: "#ffff00"
39
39
  }),
40
- darkBrown: new THREE.MeshStandardMaterial({
40
+ darkBrown: new _three2.MeshStandardMaterial({
41
41
  color: "#a0522d"
42
42
  }),
43
- brown: new THREE.MeshStandardMaterial({
43
+ brown: new _three2.MeshStandardMaterial({
44
44
  color: "#d2b48c"
45
45
  }),
46
- glass: new THREE.MeshStandardMaterial({
46
+ glass: new _three2.MeshStandardMaterial({
47
47
  color: "#ffffff",
48
48
  roughness: 0.1,
49
49
  transparent: true,
50
50
  opacity: 0.7
51
51
  }),
52
- aluminum: new THREE.MeshStandardMaterial({
52
+ aluminum: new _three2.MeshStandardMaterial({
53
53
  color: "#dcdcdc",
54
54
  metalness: 1.0,
55
55
  roughness: 0.3
56
56
  }),
57
- silver: new THREE.MeshStandardMaterial({
57
+ silver: new _three2.MeshStandardMaterial({
58
58
  color: "#c0c0c0",
59
59
  metalness: 1.0,
60
60
  roughness: 0.2
61
61
  }),
62
- gold: new THREE.MeshStandardMaterial({
62
+ gold: new _three2.MeshStandardMaterial({
63
63
  color: "#ffd700",
64
64
  metalness: 1.0,
65
65
  roughness: 0.3
66
66
  }),
67
- diamond: new THREE.MeshStandardMaterial({
67
+ diamond: new _three2.MeshStandardMaterial({
68
68
  color: "#e0f7fa",
69
69
  metalness: 0.9,
70
70
  roughness: 0.05,
@@ -267,7 +267,7 @@ function DoorModels(_ref3) {
267
267
  // --- Material Logic ---
268
268
  const doorMaterial = (0, _react.useMemo)(() => availableMaterials[testDoorMaterial] || availableMaterials[doorMaterialName] || placeholderMaterial, [testDoorMaterial, doorMaterialName]);
269
269
  const frameMaterial = (0, _react.useMemo)(() => availableMaterials[testFrameMaterial] || availableMaterials[frameMaterialName] || placeholderMaterialforFrames, [testFrameMaterial, frameMaterialName]);
270
- const gasketMaterial = (0, _react.useMemo)(() => availableMaterials[testGasketMaterial] || availableMaterials[gasketMaterialName] || new THREE.MeshStandardMaterial({
270
+ const gasketMaterial = (0, _react.useMemo)(() => availableMaterials[testGasketMaterial] || availableMaterials[gasketMaterialName] || new _three2.MeshStandardMaterial({
271
271
  color: "#111111"
272
272
  }), [testGasketMaterial, gasketMaterialName]);
273
273
  const doorStopMaterial = (0, _react.useMemo)(() => {
@@ -277,14 +277,14 @@ function DoorModels(_ref3) {
277
277
  const exteriorFanlightMaterial = (0, _react.useMemo)(() => availableMaterials[testExteriorFanlightMaterial] || availableMaterials[exteriorFanlightMaterialName] || placeholderMaterial, [testExteriorFanlightMaterial, exteriorFanlightMaterialName]);
278
278
  const occulusInfillMaterial = (0, _react.useMemo)(() => availableMaterials[testOcculusInfillMaterial] || availableMaterials[occulusInfillMaterialName] || placeholderMaterial, [testOcculusInfillMaterial, occulusInfillMaterialName]);
279
279
  const glassInfillMaterial = (0, _react.useMemo)(() => availableMaterials[testGlassInfillMaterial] || availableMaterials[glassInfillMaterialName] || placeholderMaterial, [testGlassInfillMaterial, glassInfillMaterialName]);
280
- const hingeBodyMaterial = (0, _react.useMemo)(() => availableMaterials[testHingeMaterial] || availableMaterials[hingeMaterialName] || new THREE.MeshStandardMaterial({
280
+ const hingeBodyMaterial = (0, _react.useMemo)(() => availableMaterials[testHingeMaterial] || availableMaterials[hingeMaterialName] || new _three2.MeshStandardMaterial({
281
281
  color: "#d4d4d4",
282
282
  metalness: 1.0,
283
283
  roughness: 0.4
284
284
  }), [testHingeMaterial, hingeMaterialName]);
285
285
  const frontCoverPanelMaterial = (0, _react.useMemo)(() => availableMaterials[testFrontCoverPanelMaterial] || availableMaterials[frontCoverPanelMaterialName] || placeholderMaterial, [testFrontCoverPanelMaterial, frontCoverPanelMaterialName]);
286
286
  const backCoverPanelMaterial = (0, _react.useMemo)(() => availableMaterials[testBackCoverPanelMaterial] || availableMaterials[backCoverPanelMaterialName] || placeholderMaterial, [testBackCoverPanelMaterial, backCoverPanelMaterialName]);
287
- const hingeAccentMaterial = (0, _react.useMemo)(() => new THREE.MeshStandardMaterial({
287
+ const hingeAccentMaterial = (0, _react.useMemo)(() => new _three2.MeshStandardMaterial({
288
288
  color: "#1a1a1a",
289
289
  roughness: 0.1
290
290
  }), []);
@@ -916,7 +916,7 @@ function DoorModels(_ref3) {
916
916
  args: [10, 10]
917
917
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("meshStandardMaterial", {
918
918
  color: "#f9f9f9",
919
- side: THREE.DoubleSide
919
+ side: _three2.DoubleSide
920
920
  })]
921
921
  })]
922
922
  });
@@ -0,0 +1 @@
1
+ export declare const Interface: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,130 @@
1
+ import React from "react";
2
+ type DoorType = {
3
+ doorMaterial: string;
4
+ doorWidth: number;
5
+ doorHeight: number;
6
+ theDoorDepth: number;
7
+ doorPivot: string;
8
+ doorOpening: string;
9
+ };
10
+ type DoorFrameType = {
11
+ frameMaterial: string;
12
+ doorStopMaterial?: string;
13
+ gasketMaterial: string;
14
+ hingeMaterial: string;
15
+ glassMaterial?: string;
16
+ frameDepth: number;
17
+ topThk: string;
18
+ sidesThk: string;
19
+ notchDepth: string;
20
+ notchWidth: string;
21
+ doorStopWidth: number;
22
+ doorStopDepth: number;
23
+ doorStopOffset: string;
24
+ notchposition: number;
25
+ gasketWidth: number;
26
+ gasketDepth: number;
27
+ secondDoorStopWidth: number;
28
+ secondDoorStopDepth: number;
29
+ secondDoorStopOffset: number;
30
+ };
31
+ type InteriorFanlightType = {
32
+ visible: boolean;
33
+ height: number;
34
+ material: string;
35
+ };
36
+ type ExteriorFanlightType = {
37
+ visible: boolean;
38
+ height: number;
39
+ depth: number;
40
+ material: string;
41
+ };
42
+ type OcculusType = {
43
+ visible: boolean;
44
+ infillVisible: boolean;
45
+ x1: number;
46
+ x2: number;
47
+ y1: number;
48
+ y2: number;
49
+ material: string;
50
+ depth: number;
51
+ };
52
+ type CoverPanelType = {
53
+ visible: boolean;
54
+ width: number;
55
+ height: number;
56
+ depth: number;
57
+ material: string;
58
+ };
59
+ type GlassType = {
60
+ visible: boolean;
61
+ material: string;
62
+ depth: number;
63
+ };
64
+ type ConfiguratorContextType = {
65
+ isPlaneVisible: boolean;
66
+ setIsPlaneVisible: React.Dispatch<React.SetStateAction<boolean>>;
67
+ isFrameVisible: boolean;
68
+ setIsFrameVisible: React.Dispatch<React.SetStateAction<boolean>>;
69
+ cpid: string;
70
+ setCpid: React.Dispatch<React.SetStateAction<string>>;
71
+ door: DoorType;
72
+ setDoor: React.Dispatch<React.SetStateAction<DoorType>>;
73
+ doorFrame: DoorFrameType;
74
+ setDoorFrame: React.Dispatch<React.SetStateAction<DoorFrameType>>;
75
+ interiorFanlight: InteriorFanlightType;
76
+ setInteriorFanlight: React.Dispatch<React.SetStateAction<InteriorFanlightType>>;
77
+ exteriorFanlight: ExteriorFanlightType;
78
+ setExteriorFanlight: React.Dispatch<React.SetStateAction<ExteriorFanlightType>>;
79
+ exteriorFanlightType: string;
80
+ setExteriorFanlightType: React.Dispatch<React.SetStateAction<string>>;
81
+ occulus: OcculusType;
82
+ setOcculus: React.Dispatch<React.SetStateAction<OcculusType>>;
83
+ frontCoverPanel: CoverPanelType;
84
+ setFrontCoverPanel: React.Dispatch<React.SetStateAction<CoverPanelType>>;
85
+ backCoverPanel: CoverPanelType;
86
+ setBackCoverPanel: React.Dispatch<React.SetStateAction<CoverPanelType>>;
87
+ glass: GlassType;
88
+ setGlass: React.Dispatch<React.SetStateAction<GlassType>>;
89
+ frameType: string;
90
+ setFrameType: React.Dispatch<React.SetStateAction<string>>;
91
+ bodyType: string;
92
+ setBodyType: React.Dispatch<React.SetStateAction<string>>;
93
+ totalHeight: number;
94
+ setTotalHeight: React.Dispatch<React.SetStateAction<number>>;
95
+ totalWidth: number;
96
+ setTotalWidth: React.Dispatch<React.SetStateAction<number>>;
97
+ handleParseCpid: (cpidToParse: string) => void;
98
+ testDoorMaterial: string;
99
+ setTestDoorMaterial: React.Dispatch<React.SetStateAction<string>>;
100
+ testFrameMaterial: string;
101
+ setTestFrameMaterial: React.Dispatch<React.SetStateAction<string>>;
102
+ testGasketMaterial: string;
103
+ setTestGasketMaterial: React.Dispatch<React.SetStateAction<string>>;
104
+ testInteriorFanlightMaterial: string;
105
+ setTestInteriorFanlightMaterial: React.Dispatch<React.SetStateAction<string>>;
106
+ testExteriorFanlightMaterial: string;
107
+ setTestExteriorFanlightMaterial: React.Dispatch<React.SetStateAction<string>>;
108
+ testOcculusInfillMaterial: string;
109
+ setTestOcculusInfillMaterial: React.Dispatch<React.SetStateAction<string>>;
110
+ testGlassInfillMaterial: string;
111
+ setTestGlassInfillMaterial: React.Dispatch<React.SetStateAction<string>>;
112
+ testDoorStopMaterial: string;
113
+ setTestDoorStopMaterial: React.Dispatch<React.SetStateAction<string>>;
114
+ testHingeMaterial: string;
115
+ setTestHingeMaterial: React.Dispatch<React.SetStateAction<string>>;
116
+ testFrontCoverPanelMaterial: string;
117
+ setTestFrontCoverPanelMaterial: React.Dispatch<React.SetStateAction<string>>;
118
+ testBackCoverPanelMaterial: string;
119
+ setTestBackCoverPanelMaterial: React.Dispatch<React.SetStateAction<string>>;
120
+ glassVisible: boolean;
121
+ setGlassVisible: React.Dispatch<React.SetStateAction<boolean>>;
122
+ glassDepth: number;
123
+ setGlassDepth: React.Dispatch<React.SetStateAction<number>>;
124
+ };
125
+ type ConfiguratorProviderProps = {
126
+ children: React.ReactNode;
127
+ };
128
+ export declare const ConfiguratorProvider: ({ children, }: ConfiguratorProviderProps) => import("react/jsx-runtime").JSX.Element;
129
+ export declare const useConfigurator: () => ConfiguratorContextType;
130
+ export {};