@fmsim/machine 2.0.0-beta.25 → 2.0.0-beta.27

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fmsim/machine",
3
3
  "description": "Layout View를 구성하는 설비(machine)들과 유닛을 구현한 모듈입니다.",
4
4
  "author": "heartyoh",
5
- "version": "2.0.0-beta.25",
5
+ "version": "2.0.0-beta.27",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
8
8
  "things-scene": true,
@@ -55,5 +55,5 @@
55
55
  "prettier --write"
56
56
  ]
57
57
  },
58
- "gitHead": "df172316ee6e925c87fcfeb508bc50c770643b80"
58
+ "gitHead": "6482e3e211dcafba99eef49819737c10108e99d0"
59
59
  }
@@ -119,8 +119,11 @@ export default class ConveyorJoin extends ConveyorMixin(MCSTransport) {
119
119
  if (normx * normx + normy * normy < 0.25 && ratiox * ratiox + ratioy * ratioy > 0.25) {
120
120
  const angle = normalizeAngle(Math.atan2(-normy, normx) - Math.PI / 2)
121
121
 
122
- if (angle >= startAngle && angle <= endAngle) {
123
- return true
122
+ if (startAngle <= endAngle) {
123
+ if (angle >= startAngle && angle <= endAngle) return true
124
+ } else {
125
+ // wraparound: startAngle > endAngle (예: π → 0)
126
+ if (angle >= startAngle || angle <= endAngle) return true
124
127
  }
125
128
  }
126
129
 
@@ -10,7 +10,7 @@
10
10
 
11
11
  import * as THREE from 'three'
12
12
  import * as BufferGeometryUtils from 'three/examples/jsm/utils/BufferGeometryUtils.js'
13
- import { RealObjectGroup, registerRealObjectFactory, disposeObject3D } from '@hatiolab/things-scene'
13
+ import { RealObjectGroup, registerRealObjectFactory, disposeObject3D, TriangleExtrude } from '@hatiolab/things-scene'
14
14
  import type { Component } from '@hatiolab/things-scene'
15
15
  import { LEGEND_CAPACITY } from '../features/mcs-status-default'
16
16
  import { getVaueOnRanges } from '../utils/get-value-on-ranges'
@@ -247,7 +247,6 @@ class MCSRealObject3D extends RealObjectGroup {
247
247
  opacity,
248
248
  transparent: opacity < 1,
249
249
  side: THREE.DoubleSide,
250
- depthWrite: opacity >= 0.9,
251
250
  })
252
251
  : new THREE.MeshStandardMaterial({
253
252
  color,
@@ -256,7 +255,6 @@ class MCSRealObject3D extends RealObjectGroup {
256
255
  opacity,
257
256
  transparent: opacity < 1,
258
257
  side: opacity < 1 ? THREE.DoubleSide : THREE.FrontSide,
259
- depthWrite: opacity >= 0.9,
260
258
  ...(this._config.emissiveIntensity ? { emissive: color, emissiveIntensity: this._config.emissiveIntensity } : {}),
261
259
  })
262
260
  // z-fighting 방지: 바닥면(floor grid)보다 항상 앞에 렌더링
@@ -487,9 +485,6 @@ class OHTLineRealObject3D extends RealObjectGroup {
487
485
  color: OHT_LINE_RAIL_COLOR,
488
486
  metalness: 0.5,
489
487
  roughness: 0.4,
490
- transparent: true,
491
- opacity: 1.0,
492
- depthWrite: false,
493
488
  })
494
489
 
495
490
  const geoms: THREE.BufferGeometry[] = []
@@ -856,9 +851,8 @@ class PortFlowRealObject3D extends RealObjectGroup {
856
851
 
857
852
  const mat = new THREE.MeshBasicMaterial({
858
853
  map: this._texture,
859
- transparent: true,
854
+ alphaTest: 0.1,
860
855
  side: THREE.DoubleSide,
861
- depthWrite: false,
862
856
  })
863
857
 
864
858
  this._mesh = new THREE.Mesh(geo, mat)
@@ -948,9 +942,8 @@ class NodeRealObject3D extends RealObjectGroup {
948
942
 
949
943
  const mat = new THREE.MeshBasicMaterial({
950
944
  map: this._texture,
951
- transparent: true,
945
+ alphaTest: 0.1,
952
946
  side: THREE.DoubleSide,
953
- depthWrite: false,
954
947
  })
955
948
 
956
949
  this._mesh = new THREE.Mesh(geo, mat)
@@ -985,3 +978,11 @@ class NodeRealObject3D extends RealObjectGroup {
985
978
  }
986
979
 
987
980
  registerRealObjectFactory('Node', (component: Component) => new NodeRealObject3D(component))
981
+
982
+ // Scanner — Triangle extrude + 기본 depth = Port + Carrier 높이
983
+ class ScannerExtrude extends TriangleExtrude {
984
+ get effectiveDepth(): number {
985
+ return this.component.state.depth || TRANSPORT_SURFACE_HEIGHT * 1.3
986
+ }
987
+ }
988
+ registerRealObjectFactory('Scanner', (component: Component) => new ScannerExtrude(component))
package/src/index.ts CHANGED
@@ -27,6 +27,7 @@ import './equipment'
27
27
  import './oht-line'
28
28
  import './stocker'
29
29
  import './crane-rail'
30
+ import './scanner'
30
31
 
31
32
  // vehicles
32
33
  import './agv'
@@ -74,6 +75,7 @@ export { default as Equipment } from './equipment'
74
75
  export { default as OHTLine } from './oht-line'
75
76
  export { default as Stocker } from './stocker'
76
77
  export { default as CraneRail } from './crane-rail'
78
+ export { default as Scanner } from './scanner'
77
79
 
78
80
  // ── vehicles ──
79
81
  export { default as AGV } from './agv'
package/src/scanner.ts ADDED
@@ -0,0 +1,29 @@
1
+ import { Component, ComponentNature, Triangle, sceneComponent } from '@hatiolab/things-scene'
2
+ import { MCSStatusMixin } from './features/mcs-status-mixin'
3
+
4
+ const NATURE: ComponentNature = {
5
+ mutable: true,
6
+ resizable: false,
7
+ rotatable: true,
8
+ properties: [
9
+ {
10
+ type: 'number',
11
+ label: 'round',
12
+ name: 'round',
13
+ property: { min: 0, max: 100, step: 1 }
14
+ }
15
+ ]
16
+ }
17
+
18
+ @sceneComponent('Scanner')
19
+ export default class Scanner extends MCSStatusMixin(Triangle) {
20
+ static get nature() {
21
+ return NATURE
22
+ }
23
+
24
+ is3dish() {
25
+ return true
26
+ }
27
+ }
28
+
29
+ Component.memoize(Scanner.prototype, 'path', false)
@@ -17,6 +17,7 @@ import agvLine from './agv-line'
17
17
  import ohtLine from './oht-line'
18
18
  import conveyor from './conveyor'
19
19
 
20
+ import Scanner from './scanner'
20
21
  import Node from './node'
21
22
  import DataSubscription from './data-subscription'
22
23
  import FloatingContainer from './floating-container'
@@ -41,6 +42,7 @@ export default [
41
42
  Shelf,
42
43
  Port,
43
44
 
45
+ Scanner,
44
46
  Node,
45
47
  FloatingContainer,
46
48
  DataSubscription
@@ -0,0 +1,20 @@
1
+ const icon = new URL('../../icons/equipment.png', import.meta.url).href
2
+
3
+ export default {
4
+ type: 'Scanner',
5
+ description: 'Fixed mount barcode/QR scanner',
6
+ group: ['etc'],
7
+ icon,
8
+ model: {
9
+ type: 'Scanner',
10
+ x1: 100,
11
+ y1: 100,
12
+ x2: 130,
13
+ y2: 110,
14
+ x3: 100,
15
+ y3: 120,
16
+ strokeStyle: '#333',
17
+ fillStyle: '#8899aa',
18
+ lineWidth: 1
19
+ }
20
+ }