scax-engine 0.1.6 → 0.1.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.
@@ -9018,6 +9018,7 @@ class SCAXEngineCore {
9018
9018
  x: this.toFiniteNumber(spec?.tilt?.x),
9019
9019
  y: this.toFiniteNumber(spec?.tilt?.y),
9020
9020
  },
9021
+ includeInAstigmatismSummary: spec?.includeInAstigmatismSummary !== false,
9021
9022
  }));
9022
9023
  this.currentProps = {
9023
9024
  eyeModel,
@@ -9044,6 +9045,7 @@ class SCAXEngineCore {
9044
9045
  x: this.toFiniteNumber(spec.tilt?.x),
9045
9046
  y: this.toFiniteNumber(spec.tilt?.y),
9046
9047
  },
9048
+ includeInAstigmatismSummary: spec.includeInAstigmatismSummary,
9047
9049
  })),
9048
9050
  light_source: {
9049
9051
  ...light_source,
@@ -9138,8 +9140,11 @@ class SCAXEngineCore {
9138
9140
  info: {
9139
9141
  astigmatism: {
9140
9142
  eye: this.principalMeridiansFromPowers([this.eyePower]),
9141
- lens: this.principalMeridiansFromPowers(this.lensPowers),
9142
- combined: this.principalMeridiansFromPowers([this.eyePower, ...this.lensPowers]),
9143
+ lens: this.principalMeridiansFromPowers(this.astigmatismSummaryLensPowers()),
9144
+ combined: this.principalMeridiansFromPowers([
9145
+ this.eyePower,
9146
+ ...this.astigmatismSummaryLensPowers(),
9147
+ ]),
9143
9148
  },
9144
9149
  prism: {
9145
9150
  eye: this.toPrismSummaryItem(lightDeviation.eye_prism_effect),
@@ -9348,7 +9353,18 @@ class SCAXEngineCore {
9348
9353
  ];
9349
9354
  return meridians.sort((a, b) => a.d - b.d);
9350
9355
  }
9356
+ astigmatismSummaryLensPowers() {
9357
+ return this.lensConfigs
9358
+ .filter((spec) => spec.includeInAstigmatismSummary)
9359
+ .map((spec) => ({
9360
+ s: this.toFiniteNumber(spec.s),
9361
+ c: this.toFiniteNumber(spec.c),
9362
+ ax: this.toFiniteNumber(spec.ax),
9363
+ }));
9364
+ }
9351
9365
  principalMeridiansFromPowers(powers) {
9366
+ if (powers.length === 0)
9367
+ return [];
9352
9368
  const { m, j0, j45 } = this.aggregatePowerVector(powers);
9353
9369
  return this.principalMeridiansFromVector(m, j0, j45);
9354
9370
  }
@@ -9016,6 +9016,7 @@ class SCAXEngineCore {
9016
9016
  x: this.toFiniteNumber(spec?.tilt?.x),
9017
9017
  y: this.toFiniteNumber(spec?.tilt?.y),
9018
9018
  },
9019
+ includeInAstigmatismSummary: spec?.includeInAstigmatismSummary !== false,
9019
9020
  }));
9020
9021
  this.currentProps = {
9021
9022
  eyeModel,
@@ -9042,6 +9043,7 @@ class SCAXEngineCore {
9042
9043
  x: this.toFiniteNumber(spec.tilt?.x),
9043
9044
  y: this.toFiniteNumber(spec.tilt?.y),
9044
9045
  },
9046
+ includeInAstigmatismSummary: spec.includeInAstigmatismSummary,
9045
9047
  })),
9046
9048
  light_source: {
9047
9049
  ...light_source,
@@ -9136,8 +9138,11 @@ class SCAXEngineCore {
9136
9138
  info: {
9137
9139
  astigmatism: {
9138
9140
  eye: this.principalMeridiansFromPowers([this.eyePower]),
9139
- lens: this.principalMeridiansFromPowers(this.lensPowers),
9140
- combined: this.principalMeridiansFromPowers([this.eyePower, ...this.lensPowers]),
9141
+ lens: this.principalMeridiansFromPowers(this.astigmatismSummaryLensPowers()),
9142
+ combined: this.principalMeridiansFromPowers([
9143
+ this.eyePower,
9144
+ ...this.astigmatismSummaryLensPowers(),
9145
+ ]),
9141
9146
  },
9142
9147
  prism: {
9143
9148
  eye: this.toPrismSummaryItem(lightDeviation.eye_prism_effect),
@@ -9346,7 +9351,18 @@ class SCAXEngineCore {
9346
9351
  ];
9347
9352
  return meridians.sort((a, b) => a.d - b.d);
9348
9353
  }
9354
+ astigmatismSummaryLensPowers() {
9355
+ return this.lensConfigs
9356
+ .filter((spec) => spec.includeInAstigmatismSummary)
9357
+ .map((spec) => ({
9358
+ s: this.toFiniteNumber(spec.s),
9359
+ c: this.toFiniteNumber(spec.c),
9360
+ ax: this.toFiniteNumber(spec.ax),
9361
+ }));
9362
+ }
9349
9363
  principalMeridiansFromPowers(powers) {
9364
+ if (powers.length === 0)
9365
+ return [];
9350
9366
  const { m, j0, j45 } = this.aggregatePowerVector(powers);
9351
9367
  return this.principalMeridiansFromVector(m, j0, j45);
9352
9368
  }
@@ -9022,6 +9022,7 @@
9022
9022
  x: this.toFiniteNumber(spec?.tilt?.x),
9023
9023
  y: this.toFiniteNumber(spec?.tilt?.y),
9024
9024
  },
9025
+ includeInAstigmatismSummary: spec?.includeInAstigmatismSummary !== false,
9025
9026
  }));
9026
9027
  this.currentProps = {
9027
9028
  eyeModel,
@@ -9048,6 +9049,7 @@
9048
9049
  x: this.toFiniteNumber(spec.tilt?.x),
9049
9050
  y: this.toFiniteNumber(spec.tilt?.y),
9050
9051
  },
9052
+ includeInAstigmatismSummary: spec.includeInAstigmatismSummary,
9051
9053
  })),
9052
9054
  light_source: {
9053
9055
  ...light_source,
@@ -9142,8 +9144,11 @@
9142
9144
  info: {
9143
9145
  astigmatism: {
9144
9146
  eye: this.principalMeridiansFromPowers([this.eyePower]),
9145
- lens: this.principalMeridiansFromPowers(this.lensPowers),
9146
- combined: this.principalMeridiansFromPowers([this.eyePower, ...this.lensPowers]),
9147
+ lens: this.principalMeridiansFromPowers(this.astigmatismSummaryLensPowers()),
9148
+ combined: this.principalMeridiansFromPowers([
9149
+ this.eyePower,
9150
+ ...this.astigmatismSummaryLensPowers(),
9151
+ ]),
9147
9152
  },
9148
9153
  prism: {
9149
9154
  eye: this.toPrismSummaryItem(lightDeviation.eye_prism_effect),
@@ -9352,7 +9357,18 @@
9352
9357
  ];
9353
9358
  return meridians.sort((a, b) => a.d - b.d);
9354
9359
  }
9360
+ astigmatismSummaryLensPowers() {
9361
+ return this.lensConfigs
9362
+ .filter((spec) => spec.includeInAstigmatismSummary)
9363
+ .map((spec) => ({
9364
+ s: this.toFiniteNumber(spec.s),
9365
+ c: this.toFiniteNumber(spec.c),
9366
+ ax: this.toFiniteNumber(spec.ax),
9367
+ }));
9368
+ }
9355
9369
  principalMeridiansFromPowers(powers) {
9370
+ if (powers.length === 0)
9371
+ return [];
9356
9372
  const { m, j0, j45 } = this.aggregatePowerVector(powers);
9357
9373
  return this.principalMeridiansFromVector(m, j0, j45);
9358
9374
  }
@@ -37,6 +37,12 @@ export type LensConfig = {
37
37
  x: number;
38
38
  y: number;
39
39
  };
40
+ /**
41
+ * false이면 `simulate().info.astigmatism`의 `lens`·`combined` 파워 벡터 합에서 이 항목을 빼고,
42
+ * 광선 추적·프리즘·Sturm 등은 그대로 적용합니다. (예: 시험용 JCC/크로스실린더)
43
+ * @default true
44
+ */
45
+ includeInAstigmatismSummary?: boolean;
40
46
  };
41
47
  export type EyeConfig = {
42
48
  s: number;
@@ -299,6 +305,7 @@ export declare class SCAXEngineCore {
299
305
  /** 난시 주경선 TABO 각도: 180° 동치이므로 표시·비교는 항상 [0, 180)으로 맞춘다. */
300
306
  private normalizeTaboMeridian180;
301
307
  private principalMeridiansFromVector;
308
+ private astigmatismSummaryLensPowers;
302
309
  private principalMeridiansFromPowers;
303
310
  private normalizePrismAmount;
304
311
  private normalizeAngle360;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scax-engine",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Optical calculation engine for an eye model, with ESM, CJS, and UMD builds.",
5
5
  "main": "./dist/scax-engine.cjs",
6
6
  "module": "./dist/scax-engine.js",