@processandtools/rp-article-designer 1.0.14 → 1.0.16
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/README.md +0 -0
- package/dist/components/article_designer/ArticleDesigner.d.ts +10 -0
- package/dist/components/article_designer/Designer.d.ts +4 -0
- package/dist/components/article_designer/Zone.d.ts +2 -0
- package/dist/components/article_designer/zoneElems/Back.d.ts +2 -0
- package/dist/components/article_designer/zoneElems/Bottom.d.ts +2 -0
- package/dist/components/article_designer/zoneElems/Divider.d.ts +13 -0
- package/dist/components/article_designer/zoneElems/Front.d.ts +2 -0
- package/dist/components/article_designer/zoneElems/Left.d.ts +2 -0
- package/dist/components/article_designer/zoneElems/Right.d.ts +2 -0
- package/dist/components/article_designer/zoneElems/Top.d.ts +2 -0
- package/dist/components/article_designer/zoneElems/sub_construction/LinearDividerRender.d.ts +13 -0
- package/dist/components/article_designer/zoneElems/sub_construction/SubArticleRender.d.ts +9 -0
- package/dist/components/elements_manager/PD_2D.d.ts +17 -0
- package/dist/components/elements_manager/PD_3D.d.ts +14 -0
- package/dist/components/ui/Canvas2D.d.ts +7 -0
- package/dist/components/ui/Canvas3D.d.ts +5 -0
- package/dist/components/ui/CanvasManager.d.ts +4 -0
- package/dist/components/ui/DimensionControl.d.ts +1 -0
- package/dist/components/ui/LoadingIndicator.d.ts +18 -0
- package/dist/components/ui/PerformanceMonitor.d.ts +1 -0
- package/dist/components/ui/UnifiedCanvas.d.ts +6 -0
- package/dist/components/ui/controls/VarController.d.ts +1 -0
- package/dist/components/ui/test/CustomShaderMaterial.d.ts +1 -0
- package/dist/components/ui/test/DataFieldsViewer.d.ts +8 -0
- package/dist/components/ui/test/ExtrudGeo.d.ts +1 -0
- package/dist/components/ui/test/GeneralTester.d.ts +1 -0
- package/dist/components/ui/test/MyParser.d.ts +1 -0
- package/dist/components/ui/test/PropertiesPanel.d.ts +1 -0
- package/dist/components/ui/test/TestDescriptorComparison.d.ts +6 -0
- package/dist/components/ui/test/TestDescriptorHooks.d.ts +6 -0
- package/dist/components/ui/test/TestDescriptorManager.d.ts +6 -0
- package/dist/components/ui/test/TestImageRender.d.ts +1 -0
- package/dist/components/ui/test/Test_KMS.d.ts +1 -0
- package/dist/components/ui/test/Test_MatSurfFetching.d.ts +1 -0
- package/dist/conditions/helpers/ComparisonMap.d.ts +2 -0
- package/dist/conditions/helpers/ConditionTreeEvaluator.d.ts +6 -0
- package/dist/conditions/helpers/KeyMap.d.ts +1 -0
- package/dist/conditions/types/condition.types.d.ts +39 -0
- package/dist/constants/Constants.d.ts +24 -0
- package/dist/constants/RalColors.d.ts +8 -0
- package/dist/construction_principle/cabin/CabinHelper.d.ts +52 -0
- package/dist/construction_principle/cabin/cabin.types.d.ts +4 -0
- package/dist/construction_principle/kms/KmsHelper.d.ts +50 -0
- package/dist/construction_principle/kms/KmsRenderSelector.d.ts +1 -0
- package/dist/construction_principle/kms/kms.types.d.ts +7 -0
- package/dist/construction_principle/material/MatHelper.d.ts +15 -0
- package/dist/construction_principle/material/material.types.d.ts +8 -0
- package/dist/construction_principle/render/RenderHelper.d.ts +7 -0
- package/dist/construction_principle/render/render.types.d.ts +4 -0
- package/dist/construction_principle/side_panel/CSideHelper.d.ts +52 -0
- package/dist/construction_principle/side_panel/cside.types.d.ts +4 -0
- package/dist/construction_principle/surface/SurfHelper.d.ts +15 -0
- package/dist/construction_principle/surface/surface.types.d.ts +8 -0
- package/dist/contexts/article/ArticleContext.d.ts +6 -0
- package/dist/contexts/article/ArticleProvider.d.ts +7 -0
- package/dist/contexts/article-data/DataContext.d.ts +2 -0
- package/dist/contexts/article-data/DataProvider.d.ts +2 -0
- package/dist/contexts/descriptor/DescriptorContext.d.ts +2 -0
- package/dist/contexts/descriptor/DescriptorProvider.d.ts +7 -0
- package/dist/contexts/mat-surf/MatSurfContext.d.ts +25 -0
- package/dist/contexts/mat-surf/MatSurfProvider.d.ts +9 -0
- package/dist/contexts/texture/TextureConfig.d.ts +15 -0
- package/dist/descriptor/Descriptor.d.ts +1 -0
- package/dist/descriptor/helper/DescriptorEvaluator.d.ts +7 -0
- package/dist/descriptor/helper/descriptor-type-guards.d.ts +6 -0
- package/dist/descriptor/services/DescriptorManager.d.ts +22 -0
- package/dist/descriptor/types/descriptor-data.types.d.ts +15 -0
- package/dist/descriptor/types/descriptor.types.d.ts +31 -0
- package/dist/helpers/CheckUrlExists.d.ts +1 -0
- package/dist/helpers/CpDispatcher.d.ts +53 -0
- package/dist/helpers/ExpressionResolver.d.ts +43 -0
- package/dist/helpers/GroupWrapper.d.ts +10 -0
- package/dist/helpers/LinDivHelper.d.ts +3 -0
- package/dist/helpers/LinDivPatternTransform.d.ts +2 -0
- package/dist/helpers/LindivResolver.d.ts +58 -0
- package/dist/helpers/MitreCalc.d.ts +11 -0
- package/dist/helpers/PositionHelper.d.ts +10 -0
- package/dist/helpers/VariableHelper.d.ts +2 -0
- package/dist/helpers/WallTransform.d.ts +6 -0
- package/dist/helpers/WallTransformGeo.d.ts +6 -0
- package/dist/helpers/ZoneCalculations.d.ts +425 -0
- package/dist/helpers/angls/UseClieHelper.d.ts +3 -0
- package/dist/helpers/angls/UseElemHelper.d.ts +79 -0
- package/dist/helpers/angls/UseGrtxHelper.d.ts +3 -0
- package/dist/helpers/angls/UsePrimHelper.d.ts +8 -0
- package/dist/helpers/angls/UseZoneHelper.d.ts +119 -0
- package/dist/hooks/useAPI.d.ts +5 -0
- package/dist/hooks/useArticle.d.ts +1 -0
- package/dist/hooks/useData.d.ts +1 -0
- package/dist/hooks/useDescriptor.d.ts +31 -0
- package/dist/hooks/useDescriptorManager.d.ts +2 -0
- package/dist/hooks/useMaterialLoader.d.ts +8 -0
- package/dist/hooks/useZoneSelection.d.ts +12 -0
- package/dist/hooks/zoneDescriptor.d.ts +92 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +1 -0
- package/dist/rp-article-designer.css +1 -0
- package/dist/services/ApiFactory.d.ts +20 -0
- package/dist/services/GenericApi.d.ts +25 -0
- package/dist/types/Elem.types.d.ts +10 -0
- package/dist/types/canvas.types.d.ts +7 -0
- package/dist/types/cp.types.d.ts +13 -0
- package/dist/types/data.types.d.ts +126 -0
- package/dist/types/divider.types.d.ts +81 -0
- package/dist/types/geometry.types.d.ts +19 -0
- package/dist/types/helper.types.d.ts +4 -0
- package/dist/types/pd.types.d.ts +7 -0
- package/dist/types/primitives.types.d.ts +18 -0
- package/dist/types/shape.types.d.ts +35 -0
- package/dist/types/view.types.d.ts +5 -0
- package/dist/types/wall.types.d.ts +8 -0
- package/dist/types/zone.types.d.ts +40 -0
- package/dist/variables/TestVariable.d.ts +1 -0
- package/dist/variables/TestVariableProvider.d.ts +1 -0
- package/dist/variables/VariableContext.d.ts +2 -0
- package/dist/variables/VariableProvider.d.ts +13 -0
- package/dist/variables/VariableResolver.d.ts +27 -0
- package/dist/variables/useVariables.d.ts +11 -0
- package/dist/variables/variable.types.d.ts +24 -0
- package/dist/vite.svg +0 -0
- package/package.json +10 -9
- package/dist/assets/index-DB7goBO_.js +0 -1
- package/dist/assets/index-DQ3P1g1z.css +0 -1
- package/dist/index.html +0 -14
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { MaterialTypes } from '../../construction_principle/material/material.types';
|
|
2
|
+
import { SurfaceTypes } from '../../construction_principle/surface/surface.types';
|
|
3
|
+
export interface MatSurfContextValue {
|
|
4
|
+
materials: MaterialTypes[];
|
|
5
|
+
surfaces: SurfaceTypes[];
|
|
6
|
+
loadingMaterials: Set<string>;
|
|
7
|
+
loadingSurfaces: Set<string>;
|
|
8
|
+
failedMaterials: Set<string>;
|
|
9
|
+
failedSurfaces: Set<string>;
|
|
10
|
+
fetchMaterial: (name: string) => Promise<MaterialTypes | undefined>;
|
|
11
|
+
fetchSurface: (name: string) => Promise<SurfaceTypes | undefined>;
|
|
12
|
+
queueMaterialFetch: (name: string) => void;
|
|
13
|
+
queueSurfaceFetch: (name: string) => void;
|
|
14
|
+
isFetchingMaterial: (name: string) => boolean;
|
|
15
|
+
isFetchingSurface: (name: string) => boolean;
|
|
16
|
+
hasMaterial: (name: string) => boolean;
|
|
17
|
+
hasSurface: (name: string) => boolean;
|
|
18
|
+
hasFailedMaterial: (name: string) => boolean;
|
|
19
|
+
hasFailedSurface: (name: string) => boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare const MatSurfContext: import('react').Context<MatSurfContextValue | undefined>;
|
|
22
|
+
/**
|
|
23
|
+
* Hook to access material context
|
|
24
|
+
*/
|
|
25
|
+
export declare function useMatSurfs(): MatSurfContextValue;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { MaterialTypes } from '../../construction_principle/material/material.types';
|
|
3
|
+
import { SurfaceTypes } from '../../construction_principle/surface/surface.types';
|
|
4
|
+
export interface MatSurfProviderProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
initialMaterials?: MaterialTypes[];
|
|
7
|
+
initialSurfaces?: SurfaceTypes[];
|
|
8
|
+
}
|
|
9
|
+
export declare function MatSurfProvider({ children, initialMaterials, initialSurfaces }: MatSurfProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface TextureConfigContextType {
|
|
3
|
+
textureBaseUrl: string;
|
|
4
|
+
textureFolder?: string;
|
|
5
|
+
textureExtension?: string;
|
|
6
|
+
textureSuffix?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const TextureConfigContext: import('react').Context<TextureConfigContextType>;
|
|
9
|
+
export interface TextureConfigProviderProps {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
config?: Partial<TextureConfigContextType>;
|
|
12
|
+
}
|
|
13
|
+
export declare function TextureConfigProvider({ children, config }: TextureConfigProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function useTextureConfig(): TextureConfigContextType;
|
|
15
|
+
export declare function buildTextureUrl(renderMat: string, config: TextureConfigContextType): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DescriptorEvaluationResult, DescriptorNode, DescriptorResponse } from '../types/descriptor.types';
|
|
2
|
+
import { DescriptorTypeValue } from '../types/descriptor-data.types';
|
|
3
|
+
import { VariableTree } from '../../variables/VariableResolver';
|
|
4
|
+
export declare class DescriptorEvaluator {
|
|
5
|
+
static evaluate<T extends DescriptorTypeValue>(descriptor: DescriptorResponse<T>, data: Record<string, unknown>, variableTree?: VariableTree): DescriptorEvaluationResult<T>;
|
|
6
|
+
static findAllNonDefaultMatches(descriptor: DescriptorResponse, data: Record<string, unknown>, variableTree?: VariableTree): DescriptorNode[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DescriptorData, DescriptorTypeValue } from '../types/descriptor-data.types';
|
|
2
|
+
import { DescriptorEvaluationResult } from '../types/descriptor.types';
|
|
3
|
+
export declare function isStringData(data: DescriptorData): data is string;
|
|
4
|
+
export declare function isLinDivResult(result: DescriptorEvaluationResult<DescriptorTypeValue>): result is DescriptorEvaluationResult<11>;
|
|
5
|
+
export declare function isSidePanelResult(result: DescriptorEvaluationResult<DescriptorTypeValue>): result is DescriptorEvaluationResult<13>;
|
|
6
|
+
export declare function isOtherResult(result: DescriptorEvaluationResult<DescriptorTypeValue>): result is DescriptorEvaluationResult<99>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DescriptorResponse, DescriptorEvaluationResult } from '../types/descriptor.types';
|
|
2
|
+
import { DescriptorTypeValue } from '../types/descriptor-data.types';
|
|
3
|
+
import { VariableTree } from '../../variables/VariableResolver';
|
|
4
|
+
export declare class DescriptorManager {
|
|
5
|
+
private descriptors;
|
|
6
|
+
private variableTree?;
|
|
7
|
+
constructor(descriptors: DescriptorResponse[], variableTree?: VariableTree);
|
|
8
|
+
evaluate<T extends DescriptorTypeValue = DescriptorTypeValue>(descriptorName: string, inputData: Record<string, unknown>): DescriptorEvaluationResult<T>;
|
|
9
|
+
getDescriptor(descriptorName: string): DescriptorResponse | undefined;
|
|
10
|
+
hasDescriptor(descriptorName: string): boolean;
|
|
11
|
+
getDescriptorNames(): string[];
|
|
12
|
+
getDescriptorsByType(descriptorType: DescriptorTypeValue): DescriptorResponse[];
|
|
13
|
+
findAllMatches(descriptorName: string, inputData: Record<string, unknown>): import('../types/descriptor.types').DescriptorNode<DescriptorTypeValue>[];
|
|
14
|
+
getStats(): {
|
|
15
|
+
total: number;
|
|
16
|
+
byType: Record<number, number>;
|
|
17
|
+
names: string[];
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export declare function createDescriptorManager(jsonData: DescriptorResponse[] | {
|
|
21
|
+
descriptors: DescriptorResponse[];
|
|
22
|
+
}, variableTree?: VariableTree): DescriptorManager;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const DescriptorType: {
|
|
2
|
+
readonly LIN_DIV: 11;
|
|
3
|
+
readonly SIDE_PANEL: 13;
|
|
4
|
+
readonly OTHER: 99;
|
|
5
|
+
};
|
|
6
|
+
export type DescriptorTypeValue = typeof DescriptorType[keyof typeof DescriptorType];
|
|
7
|
+
export type LinDivData = string;
|
|
8
|
+
export type SidePanelData = string;
|
|
9
|
+
export type OtherDescriptorData = string;
|
|
10
|
+
export type DescriptorData = LinDivData | SidePanelData | OtherDescriptorData;
|
|
11
|
+
export type DescriptorDataTypeMap = {
|
|
12
|
+
11: LinDivData;
|
|
13
|
+
13: SidePanelData;
|
|
14
|
+
99: OtherDescriptorData;
|
|
15
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ConditionTreeResponse } from '../../conditions/types/condition.types';
|
|
2
|
+
import { DescriptorDataTypeMap, DescriptorTypeValue } from './descriptor-data.types';
|
|
3
|
+
export interface DescriptorResponse<T extends DescriptorTypeValue = DescriptorTypeValue> {
|
|
4
|
+
descriptor: DescriptorInfo<T>;
|
|
5
|
+
nodes: DescriptorNode<T>[];
|
|
6
|
+
}
|
|
7
|
+
export interface DescriptorInfo<T extends DescriptorTypeValue = DescriptorTypeValue> {
|
|
8
|
+
NAME: string;
|
|
9
|
+
COMMENT: string;
|
|
10
|
+
SAMPDIM: number;
|
|
11
|
+
INORDER: string;
|
|
12
|
+
DATE_LASTCHANGE: string;
|
|
13
|
+
SOURCE: string;
|
|
14
|
+
PRODUCER: string;
|
|
15
|
+
SYS: boolean;
|
|
16
|
+
DESC_TYPE: T;
|
|
17
|
+
}
|
|
18
|
+
export interface DescriptorNode<T extends DescriptorTypeValue = DescriptorTypeValue> {
|
|
19
|
+
nodeNum: number;
|
|
20
|
+
lindiv: DescriptorDataTypeMap[T];
|
|
21
|
+
comment: string;
|
|
22
|
+
conditionId: number;
|
|
23
|
+
conditionTree: ConditionTreeResponse | null;
|
|
24
|
+
}
|
|
25
|
+
export interface DescriptorEvaluationResult<T extends DescriptorTypeValue = DescriptorTypeValue> {
|
|
26
|
+
lindiv: DescriptorDataTypeMap[T];
|
|
27
|
+
descriptorType: T;
|
|
28
|
+
nodeNum: number;
|
|
29
|
+
matched: boolean;
|
|
30
|
+
isDefault: boolean;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function CheckUrlExists(url: string): Promise<boolean>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { CPTypeCode } from '../types/cp.types';
|
|
2
|
+
export default function CpDispatcher(CpName: string, PartType: CPTypeCode): {
|
|
3
|
+
kms: {
|
|
4
|
+
name: string | undefined;
|
|
5
|
+
material: {
|
|
6
|
+
renderInfo: {
|
|
7
|
+
textureId: undefined;
|
|
8
|
+
isValid: boolean;
|
|
9
|
+
} | {
|
|
10
|
+
textureId: string;
|
|
11
|
+
isValid: boolean;
|
|
12
|
+
};
|
|
13
|
+
NAME: string;
|
|
14
|
+
TEXT: string;
|
|
15
|
+
THK: number;
|
|
16
|
+
MATCAT: string;
|
|
17
|
+
GRAIN: number;
|
|
18
|
+
RENDER: string;
|
|
19
|
+
} | undefined;
|
|
20
|
+
surfaceTop: {
|
|
21
|
+
renderInfo: {
|
|
22
|
+
textureId: undefined;
|
|
23
|
+
isValid: boolean;
|
|
24
|
+
} | {
|
|
25
|
+
textureId: string;
|
|
26
|
+
isValid: boolean;
|
|
27
|
+
};
|
|
28
|
+
NAME: string;
|
|
29
|
+
TEXT: string;
|
|
30
|
+
THK: number;
|
|
31
|
+
SURFCAT: string;
|
|
32
|
+
GRAIN: number;
|
|
33
|
+
RENDER: string;
|
|
34
|
+
} | undefined;
|
|
35
|
+
surfaceBot: {
|
|
36
|
+
renderInfo: {
|
|
37
|
+
textureId: undefined;
|
|
38
|
+
isValid: boolean;
|
|
39
|
+
} | {
|
|
40
|
+
textureId: string;
|
|
41
|
+
isValid: boolean;
|
|
42
|
+
};
|
|
43
|
+
NAME: string;
|
|
44
|
+
TEXT: string;
|
|
45
|
+
THK: number;
|
|
46
|
+
SURFCAT: string;
|
|
47
|
+
GRAIN: number;
|
|
48
|
+
RENDER: string;
|
|
49
|
+
} | undefined;
|
|
50
|
+
render: string | undefined;
|
|
51
|
+
thk: number;
|
|
52
|
+
};
|
|
53
|
+
} | undefined;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { VariableTree } from '../variables/VariableResolver';
|
|
2
|
+
export interface ResolveOptions {
|
|
3
|
+
variableTree?: VariableTree;
|
|
4
|
+
dataType?: 'FL' | 'IN' | 'CI' | 'CS' | 'DA' | string;
|
|
5
|
+
silent?: boolean;
|
|
6
|
+
allowFunctions?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface ResolveResult {
|
|
9
|
+
value: number | string | undefined;
|
|
10
|
+
original: string;
|
|
11
|
+
resolved: string;
|
|
12
|
+
hadVariables: boolean;
|
|
13
|
+
wasEvaluated: boolean;
|
|
14
|
+
unit?: string;
|
|
15
|
+
error?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function resolve(input: string, options?: ResolveOptions): ResolveResult;
|
|
18
|
+
export declare function resolveValue(input: string, options?: ResolveOptions): number | string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Check if a string is an IF statement
|
|
21
|
+
*/
|
|
22
|
+
export declare function isIfStatement(str: string): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Parse and evaluate an IF statement
|
|
25
|
+
* Format: IF(condition, trueValue, falseValue)
|
|
26
|
+
*
|
|
27
|
+
* Supports:
|
|
28
|
+
* - Comparisons: =, !=, <, >, <=, >=
|
|
29
|
+
* - Logical: AND, OR, NOT
|
|
30
|
+
* - Nested IF statements
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* evaluateIfStatement("IF(1 = 1, -150, 150)") // → -150
|
|
34
|
+
* evaluateIfStatement("IF(5 > 3, 100, 200)") // → 100
|
|
35
|
+
*/
|
|
36
|
+
export declare function evaluateIfStatement(expr: string, allowFunctions?: boolean): number | string;
|
|
37
|
+
export declare function isMathExpression(str: string): boolean;
|
|
38
|
+
export declare function evaluateExpression(expr: string, allowFunctions?: boolean): number;
|
|
39
|
+
export declare function clearCache(): void;
|
|
40
|
+
export declare function resolveMany(inputs: string[], options?: ResolveOptions): ResolveResult[];
|
|
41
|
+
export declare function resolveObject<T extends Record<string, unknown>>(obj: T, options?: ResolveOptions): T;
|
|
42
|
+
export declare function inspect(input: string, options?: ResolveOptions): ResolveResult;
|
|
43
|
+
export declare function canResolve(input: string, options?: ResolveOptions): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VIEW } from '../types/view.types';
|
|
2
|
+
import { FC, ReactNode } from 'react';
|
|
3
|
+
interface GroupWrapperProps {
|
|
4
|
+
view: VIEW;
|
|
5
|
+
position?: [number, number, number];
|
|
6
|
+
rotation?: [number, number, number];
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare const GroupWrapper: FC<GroupWrapperProps>;
|
|
10
|
+
export default GroupWrapper;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { VariableTree } from '../variables/VariableResolver';
|
|
2
|
+
export interface LindivResult {
|
|
3
|
+
/** Resolved lindiv string in original format (e.g., "3600mm:1", "1:1800mm") */
|
|
4
|
+
value: string;
|
|
5
|
+
/** Original input string */
|
|
6
|
+
original: string;
|
|
7
|
+
/** Whether this is a reference (starts with # or is article name) */
|
|
8
|
+
isReference: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Resolve lindiv expressions and return in original format
|
|
12
|
+
*
|
|
13
|
+
* Handles:
|
|
14
|
+
* - Simple ratios: "1:1", "2:1" → "1:1"
|
|
15
|
+
* - References: "#RP_LD_P_T100" → "RP_LD_P_T100"
|
|
16
|
+
* - Expressions: "(round(4000/1200 -0.5)*1200)mm:1" → "3600mm:1"
|
|
17
|
+
* - Reverse format: "1:((round(2700/150))*150)mm" → "1:1800mm"
|
|
18
|
+
* - With braces: "(round(X/150))*{1}" → "24*{1}"
|
|
19
|
+
* - With variables: Assumes variables are already resolved
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* resolveLindiv("(round(4000/1200 -0.5)*1200)mm:1")
|
|
23
|
+
* // → "3600mm:1"
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* resolveLindiv("1:((round(2700/150))*150)mm")
|
|
27
|
+
* // → "1:1800mm"
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* resolveLindiv("#RP_LD_P_T100")
|
|
31
|
+
* // → "RP_LD_P_T100" (removes #)
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveLindiv(lindiv: string, variableTree?: VariableTree): LindivResult;
|
|
34
|
+
/**
|
|
35
|
+
* Simpler version that just returns the resolved string value
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* resolveLindivValue("(round(4000/1200 -0.5)*1200)mm:1")
|
|
39
|
+
* // → "3600mm:1"
|
|
40
|
+
*/
|
|
41
|
+
export declare function resolveLindivValue(lindiv: string, variableTree?: VariableTree): string;
|
|
42
|
+
/**
|
|
43
|
+
* Check if lindiv is a reference (descriptor name or article name)
|
|
44
|
+
*/
|
|
45
|
+
export declare function isLindivReference(lindiv: string): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Check if a lindiv expression contains variables
|
|
48
|
+
*/
|
|
49
|
+
export declare function lindivHasVariables(lindiv: string): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Extract variable names from lindiv
|
|
52
|
+
*/
|
|
53
|
+
export declare function extractLindivVariables(lindiv: string): string[];
|
|
54
|
+
/**
|
|
55
|
+
* Format lindiv result back to string
|
|
56
|
+
* Since value is already formatted, this just adds # for references
|
|
57
|
+
*/
|
|
58
|
+
export declare function formatLindiv(result: LindivResult): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Shape } from 'three';
|
|
2
|
+
interface Point2D {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function calculateMitrePoints(length: number, thickness: number, startPanelThk?: number, endPanelThk?: number): {
|
|
7
|
+
points: Point2D[];
|
|
8
|
+
readonly svgPath: string;
|
|
9
|
+
readonly shape: Shape;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DimensionProps, PositionHelperResult } from '../types/zone.types';
|
|
2
|
+
interface PositionHelperParams {
|
|
3
|
+
divisionType: 'width' | 'depth' | 'height' | 'article' | 'independent';
|
|
4
|
+
parentDimensions: DimensionProps;
|
|
5
|
+
lengthList: number[];
|
|
6
|
+
childTREEIDs: string[];
|
|
7
|
+
dividerThk: number;
|
|
8
|
+
}
|
|
9
|
+
export default function PositionHelper({ divisionType, parentDimensions, lengthList, childTREEIDs, dividerThk }: PositionHelperParams): PositionHelperResult;
|
|
10
|
+
export {};
|