@metamesh/generator-sdk 0.18.0 → 0.20.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.
- package/CHANGELOG.md +74 -0
- package/README.md +62 -50
- package/dist/authoring.d.ts +11 -2
- package/dist/authoring.d.ts.map +1 -1
- package/dist/authoring.js +11 -2
- package/dist/authoring.js.map +1 -1
- package/dist/docs/guides/authoring.md +4 -4
- package/dist/docs/guides/package.md +62 -50
- package/dist/docs/guides/parameters.md +8 -9
- package/dist/docs/manifest.json +272 -384
- package/dist/docs/reference/fonts/FontSelection.md +6 -3
- package/dist/docs/reference/fonts/isFontSelection.md +3 -3
- package/dist/docs/reference/index/ArrayParameterDefinition.md +3 -2
- package/dist/docs/reference/index/BaseParameterDefinition.md +5 -2
- package/dist/docs/reference/index/BooleanParameterDefinition.md +3 -2
- package/dist/docs/reference/index/ChoiceOption.md +3 -2
- package/dist/docs/reference/index/ChoiceParameterDefinition.md +3 -2
- package/dist/docs/reference/index/ChoiceSetParameterDefinition.md +3 -2
- package/dist/docs/reference/index/ColorParameterDefinition.md +3 -2
- package/dist/docs/reference/index/ConditionExpression.md +3 -2
- package/dist/docs/reference/index/ContourAnchor.md +1 -1
- package/dist/docs/reference/index/ContourParameterDefinition.md +3 -2
- package/dist/docs/reference/index/ContourParameterUi.md +3 -2
- package/dist/docs/reference/index/ContourPoint.md +1 -1
- package/dist/docs/reference/index/ContourSegment.md +3 -2
- package/dist/docs/reference/index/ContourValue.md +6 -3
- package/dist/docs/reference/index/FontParameterDefinition.md +3 -2
- package/dist/docs/reference/index/GeneratorDefinition.md +3 -2
- package/dist/docs/reference/index/GeneratorIssue.md +1 -1
- package/dist/docs/reference/index/GeneratorModule.md +1 -1
- package/dist/docs/reference/index/GeneratorModuleOptions.md +5 -2
- package/dist/docs/reference/index/GeneratorParamId.md +1 -1
- package/dist/docs/reference/index/GeneratorParams.md +1 -1
- package/dist/docs/reference/index/GeneratorPreset.md +3 -2
- package/dist/docs/reference/index/GeneratorProgram.md +1 -1
- package/dist/docs/reference/index/GeneratorServices.md +6 -2
- package/dist/docs/reference/index/GeneratorTextArcBaseline.md +1 -1
- package/dist/docs/reference/index/GeneratorTextLayout.md +1 -1
- package/dist/docs/reference/index/GeneratorTextMetrics.md +10 -3
- package/dist/docs/reference/index/GeneratorTextOptions.md +7 -1
- package/dist/docs/reference/index/MAX_CONTOUR_SEGMENTS.md +1 -1
- package/dist/docs/reference/index/MAX_SIDE_PROFILE_SEGMENTS.md +1 -1
- package/dist/docs/reference/index/NumberArrayItemDefinition.md +3 -2
- package/dist/docs/reference/index/NumberArrayParameterDefinition.md +3 -2
- package/dist/docs/reference/index/NumberParameterDefinition.md +4 -3
- package/dist/docs/reference/index/NumberParameterUi.md +3 -2
- package/dist/docs/reference/index/ParameterDefinition.md +3 -2
- package/dist/docs/reference/index/ParameterDefinitionDocument.md +3 -2
- package/dist/docs/reference/index/ParameterGroup.md +1 -1
- package/dist/docs/reference/index/ParameterIssue.md +4 -3
- package/dist/docs/reference/index/ParameterIssueCode.md +1 -1
- package/dist/docs/reference/index/ParameterIssueSeverity.md +3 -2
- package/dist/docs/reference/index/ParameterScaleReference.md +5 -3
- package/dist/docs/reference/index/ParameterUi.md +5 -3
- package/dist/docs/reference/index/ParameterValidationResult.md +3 -2
- package/dist/docs/reference/index/ParameterValue.md +3 -2
- package/dist/docs/reference/index/ParameterValues.md +3 -2
- package/dist/docs/reference/index/RowParameterUi.md +3 -2
- package/dist/docs/reference/index/ScalarParameterValue.md +3 -2
- package/dist/docs/reference/index/SideProfileAnchor.md +1 -1
- package/dist/docs/reference/index/SideProfileParameterDefinition.md +3 -2
- package/dist/docs/reference/index/SideProfileParameterUi.md +3 -2
- package/dist/docs/reference/index/SideProfilePoint.md +1 -1
- package/dist/docs/reference/index/SideProfileSegment.md +3 -2
- package/dist/docs/reference/index/SideProfileValue.md +6 -3
- package/dist/docs/reference/index/SourceVisibility.md +1 -1
- package/dist/docs/reference/index/StringArrayItemDefinition.md +3 -2
- package/dist/docs/reference/index/StringArrayParameterDefinition.md +3 -2
- package/dist/docs/reference/index/SvgParameterDefinition.md +3 -2
- package/dist/docs/reference/index/TextParameterDefinition.md +3 -2
- package/dist/docs/reference/index/UNPREPARED_GENERATOR_SERVICES.md +1 -1
- package/dist/docs/reference/index/cloneContourValue.md +3 -3
- package/dist/docs/reference/index/cloneSideProfileValue.md +3 -3
- package/dist/docs/reference/index/contourValuesEqual.md +1 -1
- package/dist/docs/reference/index/defineGenerator.md +7 -3
- package/dist/docs/reference/index/defineGeneratorModule.md +1 -1
- package/dist/docs/reference/index/definePresets.md +8 -3
- package/dist/docs/reference/index/evaluateCondition.md +1 -1
- package/dist/docs/reference/index/isContourValue.md +1 -1
- package/dist/docs/reference/index/isSideProfileValue.md +1 -1
- package/dist/docs/reference/index/sideProfileValuesEqual.md +1 -1
- package/dist/docs/reference/modeling/GeneratorModel.md +1 -1
- package/dist/docs/reference/modeling/ModelDeliveryEncoder.md +14 -5
- package/dist/docs/reference/modeling/defineGeneratorModel.md +4 -1
- package/dist/docs/reference/modeling/parseGeneratorModel.md +8 -6
- package/dist/docs/reference/packages/GENERATOR_PACKAGE_FORMAT_VERSION.md +2 -2
- package/dist/docs/reference/packages/GeneratorAccess.md +3 -2
- package/dist/docs/reference/packages/GeneratorDefinitionIssue.md +3 -2
- package/dist/docs/reference/packages/GeneratorDefinitionParseResult.md +3 -2
- package/dist/docs/reference/packages/GeneratorDescriptor.md +3 -2
- package/dist/docs/reference/packages/GeneratorPackageManifest.md +3 -2
- package/dist/docs/reference/packages/GeneratorPackageSource.md +3 -2
- package/dist/docs/reference/packages/GeneratorPackageValidationError.md +3 -2
- package/dist/docs/reference/packages/GeneratorRuntimeReference.md +3 -2
- package/dist/docs/reference/packages/InstalledGenerator.md +3 -2
- package/dist/docs/reference/packages/MAX_ARRAY_ITEMS.md +2 -2
- package/dist/docs/reference/packages/MAX_CONDITION_BRANCHES.md +2 -2
- package/dist/docs/reference/packages/MAX_CONDITION_DEPTH.md +2 -2
- package/dist/docs/reference/packages/MAX_DESCRIPTOR_LIST_ITEMS.md +2 -2
- package/dist/docs/reference/packages/MAX_GENERATOR_ID_LENGTH.md +1 -1
- package/dist/docs/reference/packages/MAX_GENERATOR_PACKAGE_BYTES.md +2 -2
- package/dist/docs/reference/packages/MAX_GENERATOR_PRESETS.md +2 -2
- package/dist/docs/reference/packages/MAX_METADATA_TEXT_LENGTH.md +1 -1
- package/dist/docs/reference/packages/MAX_PARAMETERS.md +2 -2
- package/dist/docs/reference/packages/MAX_PARAMETER_GROUPS.md +2 -2
- package/dist/docs/reference/packages/MAX_PARAMETER_OPTIONS.md +2 -2
- package/dist/docs/reference/packages/MAX_TEXT_PARAMETER_LENGTH.md +2 -2
- package/dist/docs/reference/packages/METAMESH_RUNTIME_VERSION.md +3 -3
- package/dist/docs/reference/packages/compareSemanticVersions.md +7 -2
- package/dist/docs/reference/packages/isRuntimeCompatible.md +8 -2
- package/dist/docs/reference/packages/parseGeneratorDefinition.md +3 -2
- package/dist/docs/reference/packages/parseGeneratorDescriptor.md +3 -2
- package/dist/docs/reference/packages/parseGeneratorPackageManifest.md +8 -2
- package/dist/docs/reference/packages/parseParameterDefinitionDocument.md +3 -2
- package/dist/docs/reference/packages/safeParseGeneratorDefinition.md +1 -1
- package/dist/docs/reference/packages/safeParseParameterDefinitionDocument.md +1 -1
- package/dist/docs/reference/packages/validateGeneratorPresets.md +9 -3
- package/dist/docs/reference/parameters/EMPTY_SVG_PARAMETER_DEFAULT.md +2 -2
- package/dist/docs/reference/parameters/MAX_PARAMETER_ISSUES.md +2 -2
- package/dist/docs/reference/parameters/MAX_PARAMETER_ISSUE_MESSAGE_LENGTH.md +2 -2
- package/dist/docs/reference/parameters/MAX_PROJECT_SVG_PARAMETER_BYTES.md +2 -2
- package/dist/docs/reference/parameters/MAX_SVG_PARAMETER_BYTES.md +2 -2
- package/dist/docs/reference/parameters/ParamCodec.md +3 -2
- package/dist/docs/reference/parameters/ParamDecodeCode.md +3 -2
- package/dist/docs/reference/parameters/ParamDecodeError.md +3 -2
- package/dist/docs/reference/parameters/ParamDecodeIssue.md +3 -2
- package/dist/docs/reference/parameters/ParamParseResult.md +3 -2
- package/dist/docs/reference/parameters/aggregateParameterIssues.md +6 -2
- package/dist/docs/reference/parameters/createParamCodec.md +3 -1
- package/dist/docs/reference/parameters/getDefaultParameters.md +3 -2
- package/dist/docs/reference/parameters/normalizeParameters.md +3 -1
- package/dist/docs/reference/parameters/parameterValueEquals.md +3 -2
- package/dist/docs/reference/parameters/parseParameterIssues.md +5 -5
- package/dist/docs/reference/parameters/svgParameterBytes.md +3 -2
- package/dist/docs/reference/runtime/ExecuteGeneratorOptions.md +4 -2
- package/dist/docs/reference/runtime/GenerateRequest.md +3 -2
- package/dist/docs/reference/runtime/GenerationError.md +3 -2
- package/dist/docs/reference/runtime/GenerationInvalid.md +3 -2
- package/dist/docs/reference/runtime/GenerationSuccess.md +3 -2
- package/dist/docs/reference/runtime/GeneratorExecutionGenerated.md +3 -2
- package/dist/docs/reference/runtime/GeneratorExecutionInvalid.md +3 -2
- package/dist/docs/reference/runtime/GeneratorExecutionResult.md +3 -2
- package/dist/docs/reference/runtime/MeshResourceData.md +1 -1
- package/dist/docs/reference/runtime/MeshTopologyMode.md +3 -3
- package/dist/docs/reference/runtime/ModelBounds.md +3 -2
- package/dist/docs/reference/runtime/ModelData.md +1 -1
- package/dist/docs/reference/runtime/ModelDelivery.md +1 -1
- package/dist/docs/reference/runtime/ModelPartData.md +5 -4
- package/dist/docs/reference/runtime/ModelStats.md +1 -1
- package/dist/docs/reference/runtime/ModelTimings.md +6 -4
- package/dist/docs/reference/runtime/ParsedGeneratorModule.md +3 -2
- package/dist/docs/reference/runtime/PartDelivery.md +1 -1
- package/dist/docs/reference/runtime/PartDeliveryDecoder.md +6 -2
- package/dist/docs/reference/runtime/PartDeliveryLimits.md +7 -3
- package/dist/docs/reference/runtime/RuntimeError.md +3 -2
- package/dist/docs/reference/runtime/ValidateRequest.md +3 -2
- package/dist/docs/reference/runtime/ValidationError.md +3 -2
- package/dist/docs/reference/runtime/ValidationSuccess.md +3 -2
- package/dist/docs/reference/runtime/WorkerRequest.md +4 -3
- package/dist/docs/reference/runtime/WorkerResponse.md +4 -3
- package/dist/docs/reference/runtime/canonicalizeParameters.md +8 -3
- package/dist/docs/reference/runtime/executeGenerator.md +1 -1
- package/dist/docs/reference/runtime/generationIssues.md +9 -3
- package/dist/docs/reference/runtime/parseGenerationSentAt.md +7 -3
- package/dist/docs/reference/runtime/parseGeneratorModule.md +8 -3
- package/dist/docs/reference/runtime/parseModelParts.md +4 -1
- package/dist/fonts.d.ts +5 -2
- package/dist/fonts.d.ts.map +1 -1
- package/dist/fonts.js +1 -1
- package/dist/fonts.js.map +1 -1
- package/dist/generator-module.d.ts +3 -0
- package/dist/generator-module.d.ts.map +1 -1
- package/dist/generator-module.js.map +1 -1
- package/dist/generator-package/constants.d.ts +6 -1
- package/dist/generator-package/constants.d.ts.map +1 -1
- package/dist/generator-package/constants.js +6 -2
- package/dist/generator-package/constants.js.map +1 -1
- package/dist/generator-package/contracts.d.ts +2 -0
- package/dist/generator-package/contracts.d.ts.map +1 -1
- package/dist/generator-package/index.d.ts +0 -1
- package/dist/generator-package/index.d.ts.map +1 -1
- package/dist/generator-package/index.js.map +1 -1
- package/dist/generator-package/parse-package.d.ts +7 -0
- package/dist/generator-package/parse-package.d.ts.map +1 -1
- package/dist/generator-package/parse-package.js +7 -0
- package/dist/generator-package/parse-package.js.map +1 -1
- package/dist/generator-package/schemas/descriptor.schema.d.ts +1 -0
- package/dist/generator-package/schemas/descriptor.schema.d.ts.map +1 -1
- package/dist/generator-package/schemas/manifest.schema.d.ts +4 -1
- package/dist/generator-package/schemas/manifest.schema.d.ts.map +1 -1
- package/dist/generator-package/validate-manifest.d.ts +7 -1
- package/dist/generator-package/validate-manifest.d.ts.map +1 -1
- package/dist/generator-package/validate-manifest.js +7 -1
- package/dist/generator-package/validate-manifest.js.map +1 -1
- package/dist/generator-package/versions.d.ts +11 -0
- package/dist/generator-package/versions.d.ts.map +1 -1
- package/dist/generator-package/versions.js +11 -0
- package/dist/generator-package/versions.js.map +1 -1
- package/dist/generator-services.d.ts +19 -2
- package/dist/generator-services.d.ts.map +1 -1
- package/dist/generator-services.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/modeling-delivery.d.ts +14 -8
- package/dist/modeling-delivery.d.ts.map +1 -1
- package/dist/modeling-delivery.js +12 -13
- package/dist/modeling-delivery.js.map +1 -1
- package/dist/modeling.d.ts +10 -5
- package/dist/modeling.d.ts.map +1 -1
- package/dist/modeling.js +10 -5
- package/dist/modeling.js.map +1 -1
- package/dist/parameters/conditions.d.ts +1 -0
- package/dist/parameters/conditions.d.ts.map +1 -1
- package/dist/parameters/conditions.js.map +1 -1
- package/dist/parameters/contours.d.ts +6 -2
- package/dist/parameters/contours.d.ts.map +1 -1
- package/dist/parameters/contours.js +1 -1
- package/dist/parameters/contours.js.map +1 -1
- package/dist/parameters/contracts.d.ts +8 -1
- package/dist/parameters/contracts.d.ts.map +1 -1
- package/dist/parameters/definitions.d.ts +33 -3
- package/dist/parameters/definitions.d.ts.map +1 -1
- package/dist/parameters/issues.d.ts +10 -4
- package/dist/parameters/issues.d.ts.map +1 -1
- package/dist/parameters/issues.js +10 -4
- package/dist/parameters/issues.js.map +1 -1
- package/dist/parameters/limits.d.ts +7 -1
- package/dist/parameters/limits.d.ts.map +1 -1
- package/dist/parameters/limits.js +7 -1
- package/dist/parameters/limits.js.map +1 -1
- package/dist/parameters/recovery.d.ts +3 -0
- package/dist/parameters/recovery.d.ts.map +1 -1
- package/dist/parameters/recovery.js +3 -0
- package/dist/parameters/recovery.js.map +1 -1
- package/dist/parameters/side-profiles.d.ts +6 -2
- package/dist/parameters/side-profiles.d.ts.map +1 -1
- package/dist/parameters/side-profiles.js +1 -1
- package/dist/parameters/side-profiles.js.map +1 -1
- package/dist/parameters/strict.d.ts +7 -0
- package/dist/parameters/strict.d.ts.map +1 -1
- package/dist/parameters/strict.js +3 -0
- package/dist/parameters/strict.js.map +1 -1
- package/dist/parameters/values.d.ts +5 -0
- package/dist/parameters/values.d.ts.map +1 -1
- package/dist/parameters/values.js +5 -0
- package/dist/parameters/values.js.map +1 -1
- package/dist/runtime/execute-generator.d.ts +12 -1
- package/dist/runtime/execute-generator.d.ts.map +1 -1
- package/dist/runtime/execute-generator.js +7 -1
- package/dist/runtime/execute-generator.js.map +1 -1
- package/dist/runtime/model-contracts.d.ts +11 -6
- package/dist/runtime/model-contracts.d.ts.map +1 -1
- package/dist/runtime/parameter-identities.d.ts +6 -1
- package/dist/runtime/parameter-identities.d.ts.map +1 -1
- package/dist/runtime/parameter-identities.js +6 -1
- package/dist/runtime/parameter-identities.js.map +1 -1
- package/dist/runtime/parse-generator-module.d.ts +7 -1
- package/dist/runtime/parse-generator-module.d.ts.map +1 -1
- package/dist/runtime/parse-generator-module.js +6 -1
- package/dist/runtime/parse-generator-module.js.map +1 -1
- package/dist/runtime/part-delivery.d.ts +13 -2
- package/dist/runtime/part-delivery.d.ts.map +1 -1
- package/dist/runtime/part-delivery.js +8 -1
- package/dist/runtime/part-delivery.js.map +1 -1
- package/dist/runtime/worker-contracts.d.ts +18 -29
- package/dist/runtime/worker-contracts.d.ts.map +1 -1
- package/dist/runtime/worker-contracts.js +5 -1
- package/dist/runtime/worker-contracts.js.map +1 -1
- package/dist/validation/errors.d.ts +4 -1
- package/dist/validation/errors.d.ts.map +1 -1
- package/dist/validation/errors.js +2 -1
- package/dist/validation/errors.js.map +1 -1
- package/dist/validation/parse-definition.d.ts +2 -0
- package/dist/validation/parse-definition.d.ts.map +1 -1
- package/dist/validation/parse-definition.js +2 -0
- package/dist/validation/parse-definition.js.map +1 -1
- package/dist/validation/portable-data.d.ts.map +1 -1
- package/dist/validation/portable-data.js +1 -0
- package/dist/validation/portable-data.js.map +1 -1
- package/dist/validation/schemas/common.schema.d.ts +0 -1
- package/dist/validation/schemas/common.schema.d.ts.map +1 -1
- package/dist/validation/schemas/common.schema.js +1 -1
- package/dist/validation/schemas/common.schema.js.map +1 -1
- package/dist/validation/schemas/definition.schema.d.ts +0 -7
- package/dist/validation/schemas/definition.schema.d.ts.map +1 -1
- package/dist/validation/schemas/definition.schema.js +1 -1
- package/dist/validation/schemas/definition.schema.js.map +1 -1
- package/package.json +3 -3
- package/dist/docs/reference/index/FontSelection.md +0 -14
- package/dist/docs/reference/index/isFontSelection.md +0 -10
- package/dist/docs/reference/modeling/toWorldMeshes.md +0 -10
- package/dist/docs/reference/packages/GeneratorPreset.md +0 -14
- package/dist/docs/reference/runtime/Export3mfRequest.md +0 -18
- package/dist/docs/reference/runtime/ExportError.md +0 -13
- package/dist/docs/reference/runtime/ExportSuccess.md +0 -13
- package/dist/docs/reference/runtime/ExportedFile.md +0 -13
- package/dist/generator-package/versions.spec.d.ts +0 -2
- package/dist/generator-package/versions.spec.d.ts.map +0 -1
- package/dist/generator-package/versions.spec.js +0 -12
- package/dist/generator-package/versions.spec.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,79 @@
|
|
|
1
1
|
# @metamesh/generator-sdk
|
|
2
2
|
|
|
3
|
+
## 0.20.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- fe33c89: Give modeling operations, pure geometry values, numerical kernels, and mechanical calculations distinct public entry points. Import fluent values from `/geometry`, tuple and matrix kernels from `/geometry/math`, and mechanical calculations from `/geometry/mechanical`. Remove root geometry factory re-exports and ambient `matchProfiles` and thread-preflight wrappers; pure preparation accepts explicit resolution and limits exposed by the generation context.
|
|
8
|
+
|
|
9
|
+
Bounds extrema and pattern/attachment placements return fluent values. Construct anchors with one options object, project fluent vectors onto planes, and multiply raw matrices with `multiplyTransform3(left, right)`. Remove retired exports and update the SDK, CLI, Studio authoring environment, and consumers without compatibility aliases.
|
|
10
|
+
|
|
11
|
+
- 5654590: Give every public declaration exactly one import path. Shared types remain available from their owning module; consuming entries reference those types without re-exporting them. Import all export writers from `@metamesh/modeling/export`; remove the format subpaths. Import SDK font selections from `/fonts` and Generator presets from the SDK root. Remove alternate import metadata and enforce unique source and published declaration ownership without compatibility aliases.
|
|
12
|
+
- 6455ccf: Support chamfered ends on twisted extrusions, measuring normal-section setbacks on the finished
|
|
13
|
+
helical walls and preserving corner and hole correspondence. Ordinary extrusions retain their
|
|
14
|
+
native fast path. Enabled twisted end treatments support chamfers; other treatments and taper
|
|
15
|
+
with ends remain unsupported.
|
|
16
|
+
|
|
17
|
+
Breaking: replace extrusion `scaleTop` with `scale` and `divisions` with positive `slices`, counting
|
|
18
|
+
longitudinal intervals. Loft `slices` also counts intervals per supplied gap. End treatments add
|
|
19
|
+
required rings to the extrusion's requested grid. Open sweep scalar and XY `scale` now taper from
|
|
20
|
+
one to the final scale by path length; station arrays retain explicit scale control. Scale in the
|
|
21
|
+
profile's local axes before twisting, and refine untwisted sweep deformation by physical resolution.
|
|
22
|
+
|
|
23
|
+
Compiled Generators require execution protocol and runtime major 13. Rebuild packages for the new
|
|
24
|
+
binding; package format 5 is unchanged.
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Updated dependencies [fe33c89]
|
|
29
|
+
- Updated dependencies [d5dd213]
|
|
30
|
+
- Updated dependencies [ae34a4f]
|
|
31
|
+
- Updated dependencies [d5dd213]
|
|
32
|
+
- Updated dependencies [52e4e07]
|
|
33
|
+
- Updated dependencies [5654590]
|
|
34
|
+
- Updated dependencies [382d312]
|
|
35
|
+
- Updated dependencies [6455ccf]
|
|
36
|
+
- @metamesh/modeling@0.20.0
|
|
37
|
+
|
|
38
|
+
## 0.19.0
|
|
39
|
+
|
|
40
|
+
### Minor Changes
|
|
41
|
+
|
|
42
|
+
- c9de510: Extend straight extrusion end finishing to concave outlines, holes, and disconnected regions.
|
|
43
|
+
Add independent-solid `join` with a feature datum and a smooth (default) or straight width/height
|
|
44
|
+
transition against validated planar, angled, and curved sampled support patches. Both profiles use
|
|
45
|
+
the same support, collar, and whole-volume containment proofs.
|
|
46
|
+
|
|
47
|
+
Breaking: compiled Generators require Modeling runtime major 12. Rebuild packages for the new
|
|
48
|
+
host contract; old compiled runtimes are rejected. Joining preserves the supplied operands and
|
|
49
|
+
does not promise a circular fillet radius or perform automatic placement.
|
|
50
|
+
|
|
51
|
+
Replace named lazy `computed` readers with eager `memo(fn, ...args)` values. Stable pure helpers
|
|
52
|
+
reuse immutable arguments and tracked current params/context reads, with bounded recent histories
|
|
53
|
+
and native geometry retention. Update Studio diagnostics to warn about fresh function identities.
|
|
54
|
+
All authored and compiled callers must use the new API; there is no compatibility surface.
|
|
55
|
+
|
|
56
|
+
- de3d234: Add runtime-neutral STL, 3MF, and GLB export under `@metamesh/modeling/export`, with isolated
|
|
57
|
+
format entry points and backpressure-aware streaming writers. All formats consume captured local
|
|
58
|
+
geometry, placement, and appearance, with independent limits, cancellation, and structured
|
|
59
|
+
information-loss diagnostics. Standard 3MF color groups carry appearance, while base materials
|
|
60
|
+
and multiproperties retain explicit material identities independently of RGB values. These
|
|
61
|
+
properties do not assign slicer filaments or physical device trays. Add `mesh.render()` for
|
|
62
|
+
shared crease-aware display buffers that preserve exact triangle coordinates.
|
|
63
|
+
|
|
64
|
+
Breaking: remove `export3mf` and export types from `/engine`, remove SDK export request protocols
|
|
65
|
+
and `toWorldMeshes`, and return owned `Uint8Array` bytes with format metadata from the shared
|
|
66
|
+
exporters. Studio uses one export worker for every format. CLI captures use format version 3;
|
|
67
|
+
replace `run --export-3mf` with `metamesh export RUN_DIRECTORY --format 3mf --output model.3mf`.
|
|
68
|
+
Captured-run export also supports STL and GLB without rerunning source. No legacy export paths
|
|
69
|
+
or capture readers are retained.
|
|
70
|
+
|
|
71
|
+
### Patch Changes
|
|
72
|
+
|
|
73
|
+
- Updated dependencies [c9de510]
|
|
74
|
+
- Updated dependencies [de3d234]
|
|
75
|
+
- @metamesh/modeling@0.19.0
|
|
76
|
+
|
|
3
77
|
## 0.18.0
|
|
4
78
|
|
|
5
79
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
# `@metamesh/generator-sdk`
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
Turn a parametric model into a reusable MetaMesh Generator. Define its controls and presets once,
|
|
4
|
+
then use that definition to infer parameter types, validate saved values, and connect the model
|
|
5
|
+
to an editing interface.
|
|
5
6
|
|
|
6
7
|
> **Preview:** `0.x` minor releases may break compatibility. Patches remain compatible within the
|
|
7
8
|
> same minor line.
|
|
8
9
|
|
|
9
10
|
## Installation
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
Install matching SDK and Modeling releases to build the Generator below:
|
|
12
13
|
|
|
13
14
|
```bash
|
|
14
15
|
pnpm add @metamesh/generator-sdk @metamesh/modeling
|
|
@@ -18,13 +19,15 @@ The package publishes ES modules only. Use Node.js 24 or newer. TypeScript consu
|
|
|
18
19
|
TypeScript 6.0 or newer, `strict` checking, and `NodeNext` or `Bundler` module resolution.
|
|
19
20
|
Browser hosts need an ES2023-compatible runtime; the SDK's data contracts require no WebAssembly.
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
You can also use the SDK on its own for definitions, parameter handling, and package validation.
|
|
23
|
+
The optional `/modeling` adapter connects it to Modeling; your application supplies the interface
|
|
24
|
+
and execution host.
|
|
23
25
|
|
|
24
26
|
## Define controls
|
|
25
27
|
|
|
26
|
-
A Generator combines
|
|
27
|
-
|
|
28
|
+
A Generator combines a definition with a synchronous model program. This example makes a sleeve
|
|
29
|
+
with two diameter controls. Parameter types come from the definition, and an assertion checks
|
|
30
|
+
that the bore fits inside the outer wall:
|
|
28
31
|
|
|
29
32
|
```ts
|
|
30
33
|
import { defineGenerator } from "@metamesh/generator-sdk";
|
|
@@ -57,21 +60,16 @@ export default defineGeneratorModel(definition, ({ params, assert, part }) => {
|
|
|
57
60
|
});
|
|
58
61
|
```
|
|
59
62
|
|
|
60
|
-
|
|
61
|
-
`defineGeneratorModule({ definition, program })
|
|
62
|
-
is
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
`GeneratorPackageValidationError` at declaration. Both helpers retain the supplied object or array
|
|
71
|
-
and its inferred literal types. Inline parameter, editor, choice, and preset objects receive
|
|
72
|
-
TypeScript excess-property checks. Structural typing can hide extra fields in variables or generic
|
|
73
|
-
factories; runtime validation checks those fields too. These helpers validate metadata and values,
|
|
74
|
-
not model geometry or cross-parameter assertions.
|
|
63
|
+
`defineGeneratorModel` binds the definition to the model and infers its parameters and services.
|
|
64
|
+
If you already have a program, use `defineGeneratorModule({ definition, program })`. The resulting
|
|
65
|
+
runtime is a Modeling program that an engine or model test can execute directly.
|
|
66
|
+
Add named starting configurations with `definePresets(definition, presets)`; each preset supplies
|
|
67
|
+
a complete parameter map.
|
|
68
|
+
|
|
69
|
+
Definitions and presets contain serializable data, without callbacks. Hosts normalize parameters,
|
|
70
|
+
prepare assets, and execute the model. They also own forms, viewing, persistence, and export.
|
|
71
|
+
Generator modules use format 5, which carries the callback and identity in one object;
|
|
72
|
+
nested format-4 runtimes are unsupported.
|
|
75
73
|
|
|
76
74
|
## Generator capabilities
|
|
77
75
|
|
|
@@ -82,43 +80,57 @@ not model geometry or cross-parameter assertions.
|
|
|
82
80
|
| Parameters and presets | Inferred TypeScript types, defaults, recovering normalization, strict codecs, and complete serializable presets. |
|
|
83
81
|
| Host integration | Validated package manifests, module execution, Worker messages, and incremental mesh delivery. |
|
|
84
82
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
Conditional visibility changes which controls appear. Hidden values remain saved and still
|
|
84
|
+
require validation. Put constraints between parameters in the model's assertions.
|
|
85
|
+
|
|
86
|
+
## Validate definitions and values
|
|
87
|
+
|
|
88
|
+
`defineGenerator` checks the definition as soon as you declare it. `definePresets` checks preset
|
|
89
|
+
metadata and complete canonical values. Invalid declarations throw
|
|
90
|
+
`GeneratorPackageValidationError`. These helpers retain the supplied object or array and its
|
|
91
|
+
inferred literal types; they don't execute geometry or model assertions.
|
|
92
|
+
|
|
93
|
+
Inline parameter, editor, choice, and preset objects receive TypeScript excess-property checks.
|
|
94
|
+
Runtime validation also catches extra fields that structural typing can hide in variables or
|
|
95
|
+
generic factories.
|
|
88
96
|
|
|
89
97
|
Use `normalizeParameters` to recover saved values: it drops unknown keys, restores defaults, and
|
|
90
|
-
clamps numbers.
|
|
91
|
-
|
|
98
|
+
clamps numbers. Use `createParamCodec(definition)` when inputs must already be complete and
|
|
99
|
+
canonical; it rejects missing or unknown fields and invalid values. The
|
|
100
|
+
[parameter guide](https://github.com/JasonKoolman/metamesh/blob/main/apps/web/content/docs/develop/parameters-and-validation.mdx)
|
|
92
101
|
covers controls, conditions, and validation.
|
|
93
102
|
|
|
94
|
-
Use the codec's `parse()` to throw on invalid input, or `safeParse()` for a
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
Hosts can pass
|
|
103
|
+
Use the codec's `parse()` to throw on invalid input, or `safeParse()` for a result you can check
|
|
104
|
+
without catching an exception. A failed parse reports issues without substitute parameters. Each `ParameterIssue` names
|
|
105
|
+
a control with `parameterId`; an optional `path` addresses a field within that control's value.
|
|
106
|
+
Hosts can pass these issues directly to `aggregateParameterIssues`.
|
|
107
|
+
|
|
108
|
+
## Execute and deliver a model
|
|
98
109
|
|
|
99
110
|
`executeGenerator` always validates its single `parameters` map against the current definition.
|
|
100
|
-
Hosts
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
beside them. Decode resource references before application use and convert to world meshes before
|
|
118
|
-
export. Receiving hosts own the buffers and keep them immutable and attached.
|
|
111
|
+
Hosts can validate before loading assets, but execution still checks the supplied values.
|
|
112
|
+
Modeling hosts use `parseGeneratorModel(value, definition)` from `/modeling` to validate a loaded
|
|
113
|
+
module and infer its executable `GeneratorModel<typeof definition>` type. Pass the default export
|
|
114
|
+
itself for local entries that also export their definition; packaged namespaces contain only the
|
|
115
|
+
default export. Use `parseGeneratorModule` from `/runtime` when you don't need the Modeling adapter.
|
|
116
|
+
Invalid module envelopes throw `TypeError`; package validation reports MetaMesh issues and errors.
|
|
117
|
+
|
|
118
|
+
For Worker hosts, `/modeling` supplies `ModelDeliveryEncoder`; `/runtime` supplies `PartDeliveryDecoder`.
|
|
119
|
+
Transfers carry local buffers under `geometry`, with placement beside them. Decode resource
|
|
120
|
+
references before application use or export. Receiving hosts own the buffers and keep them immutable
|
|
121
|
+
and attached.
|
|
122
|
+
|
|
123
|
+
Model statistics use `signedVolume` in mm³. `generateMs` measures the engine run;
|
|
124
|
+
`timings.totalMs` covers the host workflow, including stages outside the engine. Hosts report only
|
|
125
|
+
the timing stages they measure, using `paramsMs` for parameter processing and `finalizeMs` for
|
|
126
|
+
finalization. `byteCount` counts finalized world-space position and index buffer bytes, counting
|
|
127
|
+
shared buffers once; it doesn't measure the local buffers transferred by a Worker.
|
|
119
128
|
|
|
120
129
|
## API entry points
|
|
121
130
|
|
|
131
|
+
Each public type and function has one import path. Import `FontSelection` and `isFontSelection`
|
|
132
|
+
from `/fonts`, and `GeneratorPreset` from the package root.
|
|
133
|
+
|
|
122
134
|
| Import | Responsibility |
|
|
123
135
|
| ------------------------------------ | ------------------------------------------------------------------- |
|
|
124
136
|
| `@metamesh/generator-sdk` | Definitions, presets, inferred types, and module authoring. |
|
package/dist/authoring.d.ts
CHANGED
|
@@ -3,11 +3,20 @@ import type { GeneratorDefinition, ParameterDefinition } from "./parameters/defi
|
|
|
3
3
|
type DefinitionParameters<P extends readonly ParameterDefinition[]> = readonly ParameterDefinition[] | {
|
|
4
4
|
readonly [Index in keyof P]: ParameterDefinition;
|
|
5
5
|
};
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Validates Generator metadata while preserving literal control types; invalid definitions throw.
|
|
8
|
+
*
|
|
9
|
+
* @param definition - Serializable controls and metadata; returned unchanged after validation.
|
|
10
|
+
*/
|
|
7
11
|
export declare function defineGenerator<const D extends GeneratorDefinition>(definition: D & Omit<GeneratorDefinition, "parameters"> & {
|
|
8
12
|
readonly parameters: DefinitionParameters<NoInfer<D["parameters"]>>;
|
|
9
13
|
}): D;
|
|
10
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Validates preset metadata and complete canonical values while preserving literal types.
|
|
16
|
+
*
|
|
17
|
+
* @param definition - Definition whose complete parameter map each preset must supply.
|
|
18
|
+
* @param presets - Preset values and metadata; returned without copying.
|
|
19
|
+
*/
|
|
11
20
|
export declare function definePresets<const D extends GeneratorDefinition, const Presets extends readonly GeneratorPreset<NoInfer<D>>[]>(definition: D, presets: Presets & readonly GeneratorPreset<NoInfer<D>>[]): Presets;
|
|
12
21
|
export {};
|
|
13
22
|
//# sourceMappingURL=authoring.d.ts.map
|
package/dist/authoring.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring.d.ts","sourceRoot":"","sources":["../src/authoring.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAK5F,KAAK,oBAAoB,CAAC,CAAC,SAAS,SAAS,mBAAmB,EAAE,IAChE,SAAS,mBAAmB,EAAE,GAAG;IAAE,QAAQ,EAAE,KAAK,IAAI,MAAM,CAAC,GAAG,mBAAmB;CAAE,CAAC;AAExF
|
|
1
|
+
{"version":3,"file":"authoring.d.ts","sourceRoot":"","sources":["../src/authoring.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAK5F,KAAK,oBAAoB,CAAC,CAAC,SAAS,SAAS,mBAAmB,EAAE,IAChE,SAAS,mBAAmB,EAAE,GAAG;IAAE,QAAQ,EAAE,KAAK,IAAI,MAAM,CAAC,GAAG,mBAAmB;CAAE,CAAC;AAExF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,CAAC,CAAC,SAAS,mBAAmB,EACjE,UAAU,EAAE,CAAC,GACX,IAAI,CAAC,mBAAmB,EAAE,YAAY,CAAC,GAAG;IACxC,QAAQ,CAAC,UAAU,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CACrE,GACF,CAAC,CAGH;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,KAAK,CAAC,CAAC,SAAS,mBAAmB,EACnC,KAAK,CAAC,OAAO,SAAS,SAAS,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAC5D,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,CAGnF"}
|
package/dist/authoring.js
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import { validateGeneratorPresets } from "./generator-package/validate-manifest.js";
|
|
2
2
|
import { parseGeneratorDefinition } from "./validation/parse-definition.js";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Validates Generator metadata while preserving literal control types; invalid definitions throw.
|
|
5
|
+
*
|
|
6
|
+
* @param definition - Serializable controls and metadata; returned unchanged after validation.
|
|
7
|
+
*/
|
|
4
8
|
export function defineGenerator(definition) {
|
|
5
9
|
parseGeneratorDefinition(definition);
|
|
6
10
|
return definition;
|
|
7
11
|
}
|
|
8
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Validates preset metadata and complete canonical values while preserving literal types.
|
|
14
|
+
*
|
|
15
|
+
* @param definition - Definition whose complete parameter map each preset must supply.
|
|
16
|
+
* @param presets - Preset values and metadata; returned without copying.
|
|
17
|
+
*/
|
|
9
18
|
export function definePresets(definition, presets) {
|
|
10
19
|
validateGeneratorPresets(definition, presets);
|
|
11
20
|
return presets;
|
package/dist/authoring.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring.js","sourceRoot":"","sources":["../src/authoring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAGpF,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAO5E
|
|
1
|
+
{"version":3,"file":"authoring.js","sourceRoot":"","sources":["../src/authoring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAGpF,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAO5E;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAC7B,UAGG;IAEH,wBAAwB,CAAC,UAAU,CAAC,CAAC;IACrC,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAG3B,UAAa,EAAE,OAAyD;IACxE,wBAAwB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC9C,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -10,10 +10,10 @@ If you need a working model first, follow [Build your first code Project](https:
|
|
|
10
10
|
```ts
|
|
11
11
|
const { width, depth, height, holeDiameter, addHole } = params;
|
|
12
12
|
const body = box({ size: [width, depth, height] });
|
|
13
|
-
if (!addHole) return
|
|
13
|
+
if (!addHole) return part("body", body);
|
|
14
14
|
// Two extra millimetres clear the centered body's top and bottom faces.
|
|
15
15
|
const bore = cylinder({ height: height + 2, diameter: holeDiameter, sizing: "face" });
|
|
16
|
-
return
|
|
16
|
+
return part("body", body.subtract(bore));
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
A plate is a useful starting example: its controls describe the finished size and an optional hole, while the source handles construction.
|
|
@@ -103,9 +103,9 @@ Use `@metamesh/generator-sdk` to define its controls and Generator module, and
|
|
|
103
103
|
`@metamesh/modeling` for generation. Studio's virtual `@metamesh/project` import is specific to
|
|
104
104
|
Studio and can't be copied into a local Node module.
|
|
105
105
|
|
|
106
|
-
Follow [local authoring](https://metamesh.studio/docs/develop/
|
|
106
|
+
Follow [local authoring](https://metamesh.studio/docs/develop/cli#generator-entries) to check and run the
|
|
107
107
|
module with the CLI, inspect dimensions and named parts, and render the captured result. Add
|
|
108
|
-
[Testkit checks](https://metamesh.studio/docs/develop/
|
|
108
|
+
[Testkit checks](https://metamesh.studio/docs/develop/cli#test-models) when you need repeatable assertions for
|
|
109
109
|
defaults, presets, supported bounds, or validation recovery. Keep those tests in your project's
|
|
110
110
|
test runner; the CLI owns compilation and capture tools.
|
|
111
111
|
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
# `@metamesh/generator-sdk`
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
Turn a parametric model into a reusable MetaMesh Generator. Define its controls and presets once,
|
|
4
|
+
then use that definition to infer parameter types, validate saved values, and connect the model
|
|
5
|
+
to an editing interface.
|
|
5
6
|
|
|
6
7
|
> **Preview:** `0.x` minor releases may break compatibility. Patches remain compatible within the
|
|
7
8
|
> same minor line.
|
|
8
9
|
|
|
9
10
|
## Installation
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
Install matching SDK and Modeling releases to build the Generator below:
|
|
12
13
|
|
|
13
14
|
```bash
|
|
14
15
|
pnpm add @metamesh/generator-sdk @metamesh/modeling
|
|
@@ -18,13 +19,15 @@ The package publishes ES modules only. Use Node.js 24 or newer. TypeScript consu
|
|
|
18
19
|
TypeScript 6.0 or newer, `strict` checking, and `NodeNext` or `Bundler` module resolution.
|
|
19
20
|
Browser hosts need an ES2023-compatible runtime; the SDK's data contracts require no WebAssembly.
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
You can also use the SDK on its own for definitions, parameter handling, and package validation.
|
|
23
|
+
The optional `/modeling` adapter connects it to Modeling; your application supplies the interface
|
|
24
|
+
and execution host.
|
|
23
25
|
|
|
24
26
|
## Define controls
|
|
25
27
|
|
|
26
|
-
A Generator combines
|
|
27
|
-
|
|
28
|
+
A Generator combines a definition with a synchronous model program. This example makes a sleeve
|
|
29
|
+
with two diameter controls. Parameter types come from the definition, and an assertion checks
|
|
30
|
+
that the bore fits inside the outer wall:
|
|
28
31
|
|
|
29
32
|
```ts
|
|
30
33
|
import { defineGenerator } from "@metamesh/generator-sdk";
|
|
@@ -57,21 +60,16 @@ export default defineGeneratorModel(definition, ({ params, assert, part }) => {
|
|
|
57
60
|
});
|
|
58
61
|
```
|
|
59
62
|
|
|
60
|
-
|
|
61
|
-
`defineGeneratorModule({ definition, program })
|
|
62
|
-
is
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
`GeneratorPackageValidationError` at declaration. Both helpers retain the supplied object or array
|
|
71
|
-
and its inferred literal types. Inline parameter, editor, choice, and preset objects receive
|
|
72
|
-
TypeScript excess-property checks. Structural typing can hide extra fields in variables or generic
|
|
73
|
-
factories; runtime validation checks those fields too. These helpers validate metadata and values,
|
|
74
|
-
not model geometry or cross-parameter assertions.
|
|
63
|
+
`defineGeneratorModel` binds the definition to the model and infers its parameters and services.
|
|
64
|
+
If you already have a program, use `defineGeneratorModule({ definition, program })`. The resulting
|
|
65
|
+
runtime is a Modeling program that an engine or model test can execute directly.
|
|
66
|
+
Add named starting configurations with `definePresets(definition, presets)`; each preset supplies
|
|
67
|
+
a complete parameter map.
|
|
68
|
+
|
|
69
|
+
Definitions and presets contain serializable data, without callbacks. Hosts normalize parameters,
|
|
70
|
+
prepare assets, and execute the model. They also own forms, viewing, persistence, and export.
|
|
71
|
+
Generator modules use format 5, which carries the callback and identity in one object;
|
|
72
|
+
nested format-4 runtimes are unsupported.
|
|
75
73
|
|
|
76
74
|
## Generator capabilities
|
|
77
75
|
|
|
@@ -82,43 +80,57 @@ not model geometry or cross-parameter assertions.
|
|
|
82
80
|
| Parameters and presets | Inferred TypeScript types, defaults, recovering normalization, strict codecs, and complete serializable presets. |
|
|
83
81
|
| Host integration | Validated package manifests, module execution, Worker messages, and incremental mesh delivery. |
|
|
84
82
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
Conditional visibility changes which controls appear. Hidden values remain saved and still
|
|
84
|
+
require validation. Put constraints between parameters in the model's assertions.
|
|
85
|
+
|
|
86
|
+
## Validate definitions and values
|
|
87
|
+
|
|
88
|
+
`defineGenerator` checks the definition as soon as you declare it. `definePresets` checks preset
|
|
89
|
+
metadata and complete canonical values. Invalid declarations throw
|
|
90
|
+
`GeneratorPackageValidationError`. These helpers retain the supplied object or array and its
|
|
91
|
+
inferred literal types; they don't execute geometry or model assertions.
|
|
92
|
+
|
|
93
|
+
Inline parameter, editor, choice, and preset objects receive TypeScript excess-property checks.
|
|
94
|
+
Runtime validation also catches extra fields that structural typing can hide in variables or
|
|
95
|
+
generic factories.
|
|
88
96
|
|
|
89
97
|
Use `normalizeParameters` to recover saved values: it drops unknown keys, restores defaults, and
|
|
90
|
-
clamps numbers.
|
|
91
|
-
|
|
98
|
+
clamps numbers. Use `createParamCodec(definition)` when inputs must already be complete and
|
|
99
|
+
canonical; it rejects missing or unknown fields and invalid values. The
|
|
100
|
+
[parameter guide](https://github.com/JasonKoolman/metamesh/blob/main/apps/web/content/docs/develop/parameters-and-validation.mdx)
|
|
92
101
|
covers controls, conditions, and validation.
|
|
93
102
|
|
|
94
|
-
Use the codec's `parse()` to throw on invalid input, or `safeParse()` for a
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
Hosts can pass
|
|
103
|
+
Use the codec's `parse()` to throw on invalid input, or `safeParse()` for a result you can check
|
|
104
|
+
without catching an exception. A failed parse reports issues without substitute parameters. Each `ParameterIssue` names
|
|
105
|
+
a control with `parameterId`; an optional `path` addresses a field within that control's value.
|
|
106
|
+
Hosts can pass these issues directly to `aggregateParameterIssues`.
|
|
107
|
+
|
|
108
|
+
## Execute and deliver a model
|
|
98
109
|
|
|
99
110
|
`executeGenerator` always validates its single `parameters` map against the current definition.
|
|
100
|
-
Hosts
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
beside them. Decode resource references before application use and convert to world meshes before
|
|
118
|
-
export. Receiving hosts own the buffers and keep them immutable and attached.
|
|
111
|
+
Hosts can validate before loading assets, but execution still checks the supplied values.
|
|
112
|
+
Modeling hosts use `parseGeneratorModel(value, definition)` from `/modeling` to validate a loaded
|
|
113
|
+
module and infer its executable `GeneratorModel<typeof definition>` type. Pass the default export
|
|
114
|
+
itself for local entries that also export their definition; packaged namespaces contain only the
|
|
115
|
+
default export. Use `parseGeneratorModule` from `/runtime` when you don't need the Modeling adapter.
|
|
116
|
+
Invalid module envelopes throw `TypeError`; package validation reports MetaMesh issues and errors.
|
|
117
|
+
|
|
118
|
+
For Worker hosts, `/modeling` supplies `ModelDeliveryEncoder`; `/runtime` supplies `PartDeliveryDecoder`.
|
|
119
|
+
Transfers carry local buffers under `geometry`, with placement beside them. Decode resource
|
|
120
|
+
references before application use or export. Receiving hosts own the buffers and keep them immutable
|
|
121
|
+
and attached.
|
|
122
|
+
|
|
123
|
+
Model statistics use `signedVolume` in mm³. `generateMs` measures the engine run;
|
|
124
|
+
`timings.totalMs` covers the host workflow, including stages outside the engine. Hosts report only
|
|
125
|
+
the timing stages they measure, using `paramsMs` for parameter processing and `finalizeMs` for
|
|
126
|
+
finalization. `byteCount` counts finalized world-space position and index buffer bytes, counting
|
|
127
|
+
shared buffers once; it doesn't measure the local buffers transferred by a Worker.
|
|
119
128
|
|
|
120
129
|
## API entry points
|
|
121
130
|
|
|
131
|
+
Each public type and function has one import path. Import `FontSelection` and `isFontSelection`
|
|
132
|
+
from `/fonts`, and `GeneratorPreset` from the package root.
|
|
133
|
+
|
|
122
134
|
| Import | Responsibility |
|
|
123
135
|
| ------------------------------------ | ------------------------------------------------------------------- |
|
|
124
136
|
| `@metamesh/generator-sdk` | Definitions, presets, inferred types, and module authoring. |
|
|
@@ -87,7 +87,7 @@ and `items.ui.step`.
|
|
|
87
87
|
A Font value contains the selected face and weight. Pass the whole value, rather than a family-name
|
|
88
88
|
string, in `services.text.layout(text, { font, fontSize })` inside generation, then pass its layout to
|
|
89
89
|
`textSection(layout)`. Studio loads declared fonts before generation. See the
|
|
90
|
-
[text recipe](https://metamesh.studio/docs/develop/
|
|
90
|
+
[text recipe](https://metamesh.studio/docs/develop/svg-and-text#text-from-a-font-parameter) for the setup and offline
|
|
91
91
|
limits.
|
|
92
92
|
|
|
93
93
|
## Show controls side by side
|
|
@@ -269,7 +269,7 @@ with a `parameterId` and positive `factor`, such as `{ "parameterId": "width", "
|
|
|
269
269
|
Bindings describe the coordinate envelope; they never rescale the saved value. Without them,
|
|
270
270
|
the editor displays percentages.
|
|
271
271
|
|
|
272
|
-
Inside generation or a
|
|
272
|
+
Inside generation or a memo helper, pass `params.crossSection` to
|
|
273
273
|
[`sampleContour()`](https://metamesh.studio/docs/reference/geometry/sampleContour) with physical `widthScale`,
|
|
274
274
|
`heightScale`, and a millimetre resolution policy. It returns an immutable counterclockwise
|
|
275
275
|
XY `Contour` without a duplicated seam, rejecting invalid sampled topology and exhausted budgets.
|
|
@@ -382,10 +382,10 @@ than your model's recommended minimum. A zero wall stops generation; a 0.5 mm wa
|
|
|
382
382
|
with a warning. Choose that minimum for the model and manufacturing process. A failed edit leaves
|
|
383
383
|
the last valid preview and its export available. Warnings allow a current model to generate and export.
|
|
384
384
|
|
|
385
|
-
Checks follow JavaScript order:
|
|
385
|
+
Checks follow JavaScript order: `memo` calls run their helper on a cache miss, and measuring
|
|
386
386
|
geometry evaluates its input first. Draft validation checks declarations and reached assertions
|
|
387
|
-
without finalizing parts; it doesn't prove full geometric validity. Use optional `
|
|
388
|
-
|
|
387
|
+
without finalizing parts; it doesn't prove full geometric validity. Use optional `memo`
|
|
388
|
+
calls to reuse expensive layouts or shared calculations across unrelated edits. There is no
|
|
389
389
|
separate preparation callback.
|
|
390
390
|
|
|
391
391
|
## Test the definition as a contract
|
|
@@ -410,11 +410,10 @@ values with `model.ts`; check the workspace for source or cross-field errors bef
|
|
|
410
410
|
|
|
411
411
|
|
|
412
412
|
|
|
413
|
-
**
|
|
413
|
+
**Controls describe; TypeScript decides**
|
|
414
414
|
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
the Project definition.
|
|
415
|
+
The definition declares inputs and visibility. Put derived values, geometry checks, and rules
|
|
416
|
+
between parameters in `generate`. Use `assert` or `warn` to identify the control to fix.
|
|
418
417
|
|
|
419
418
|
|
|
420
419
|
|