diff --git a/LICENSE b/LICENSE index 87a328f2..f82c4c75 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025 Bit By Bit Developers +Copyright (c) 2026 Bit by bit developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 720d65ba..df9b957a 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,8 @@ https://github.com/bitbybit-dev/bitbybit BabylonJS game engine integration that allows easy drawing of geometry constructed by JSCAD, Manifold and OCCT kernels. [@bitbybit-dev/threejs](https://www.npmjs.com/package/@bitbybit-dev/threejs) ThreeJS game engine integration that allows easy drawing of geometry constructed by JSCAD, Manifold and OCCT kernels. +[@bitbybit-dev/playcanvas](https://www.npmjs.com/package/@bitbybit-dev/playcanvas) +PlayCanvas game engine integration that allows easy drawing of geometry constructed by JSCAD, Manifold and OCCT kernels. [@bitbybit-dev/core](https://www.npmjs.com/package/@bitbybit-dev/core) Assembles various packages and provides additional features that may combine all CAD kernels [@bitbybit-dev/jscad](https://www.npmjs.com/package/@bitbybit-dev/jscad) @@ -132,6 +134,8 @@ You can also run tests for individual packages: - `npm run test-jscad` - Test JSCAD package - `npm run test-manifold` - Test Manifold package - `npm run test-threejs` - Test ThreeJS package +- `npm run test-playcanvas` - Test PlayCanvas package +- `npm run test-babylonjs` - Test BabylonJS package ### Troubleshooting If you encounter issues during setup: @@ -140,4 +144,4 @@ If you encounter issues during setup: 3. Delete node_modules and package-lock.json, then run `npm install` ## Major Dependencies -BabylonJS, ThreeJS, OpenCascade, Manifold, JSCAD, Verbnurbs \ No newline at end of file +BabylonJS, ThreeJS, PlayCanvas, OpenCascade, Manifold, JSCAD, Verbnurbs \ No newline at end of file diff --git a/UNIT_TESTING_GUIDE.md b/UNIT_TESTING_GUIDE.md new file mode 100644 index 00000000..850812e7 --- /dev/null +++ b/UNIT_TESTING_GUIDE.md @@ -0,0 +1,429 @@ +# Bitbybit Unit Testing Guide + +This guide covers unit testing best practices and conventions for the Bitbybit monorepo. + +## Tech Stack + +- **Language:** TypeScript +- **Test Framework:** Jest with ts-jest preset +- **Assertion Style:** Jest's built-in expect assertions + +## Package Structure + +Each folder under `packages/dev/` is an **independent npm package** with its own: +- `package.json` with dependencies and test scripts +- Jest configuration +- Coverage report (generated in package directory when running `npm run test-c`) + +``` +packages/dev/ +├── base/ ← @bitbybit-dev/base +├── babylonjs/ ← @bitbybit-dev/babylonjs +├── threejs/ ← @bitbybit-dev/threejs +├── playcanvas/ ← @bitbybit-dev/playcanvas +├── occt/ ← @bitbybit-dev/occt +├── occt-worker/ ← @bitbybit-dev/occt-worker +├── jscad/ ← @bitbybit-dev/jscad +├── jscad-worker/ ← @bitbybit-dev/jscad-worker +├── manifold/ ← @bitbybit-dev/manifold +├── manifold-worker/← @bitbybit-dev/manifold-worker +└── core/ ← @bitbybit-dev/core +``` + +Navigate to a specific package to run tests or view coverage for that package. + +## File Naming & Location + +- **Naming convention:** `.test.ts` +- **Location:** Test files are placed **next to the file being tested**, not in a separate test directory. + +``` +lib/api/ +├── bitbybit-base.ts +├── bitbybit-base.test.ts ← test file adjacent to source +├── context.ts +├── context.test.ts ← test file adjacent to source +└── draw-helper.ts +└── draw-helper.test.ts ← test file adjacent to source +``` + +## Mock Organization + +Reusable mocks are placed in the `__mocks__` folder at the highest level of the source code directory: + +``` +lib/api/ +├── __mocks__/ +│ ├── babylonjs.mock.ts ← reusable BabylonJS mocks +│ └── test-helpers.ts ← factory functions for test setup +├── bitbybit-base.ts +└── bitbybit-base.test.ts +``` + +### Mock Usage Pattern + +```typescript +jest.mock("@babylonjs/core", () => { + const { createBabylonJSMock } = jest.requireActual("./__mocks__/babylonjs.mock"); + return createBabylonJSMock(); +}); +``` + +## Running Tests + +| Command | Description | +|---------|-------------| +| `npm run test` | Run all package tests | +| `npm run test-base` | Test base package | +| `npm run test-occt` | Test OCCT package | +| `npm run test-core` | Test core package | +| `npm run test-jscad` | Test JSCAD package | +| `npm run test-manifold` | Test Manifold package | +| `npm run test-threejs` | Test ThreeJS package | +| `npm run test-playcavnas` | Test PlayCanvas package | + +Within individual packages: +- `npm run test` - Watch mode +- `npm run test-c` - Coverage mode (CI) +- `npm run test-c-l` - Coverage with watch mode + +## AAA Pattern (Arrange-Act-Assert) + +Structure every test using the AAA pattern: + +```typescript +it("should calculate distance between two points", () => { + // Arrange - set up test data + const startPoint = [0, 0, 0]; + const endPoint = [3, 4, 0]; + + // Act - execute the code under test + const result = bitByBit.point.distance({ startPoint, endPoint }); + + // Assert - verify expected outcome + expect(result).toBeCloseTo(5, 5); +}); +``` + +## TypeScript Best Practices + +### Avoid `as any` + +Minimize use of `as any` type assertions. Instead: + +1. **Create properly typed mocks** in the `__mocks__` folder +2. **Use `as unknown as Type`** when casting is necessary (two-step cast is more explicit) +3. **Define mock interfaces** that match the expected type contract + +```typescript +// ❌ Avoid +const mockScene = {} as any; + +// ✅ Prefer typed mock +const mockScene = new MockScene() as unknown as BABYLON.Scene; + +// ✅ Or create a proper mock class +export class MockScene { + meshes: MockMesh[] = []; + getMeshByName(name: string) { /* ... */ } +} +``` + +## Assertion Best Practices + +### Test Specific Results, Not Generic Outcomes + +```typescript +// ❌ Avoid vague assertions +expect(result).toBeDefined(); +expect(result.length).toBeGreaterThan(0); +expect(result).toBeTruthy(); + +// ✅ Test specific expected values +expect(result).toEqual([5, 7, 9]); +expect(result.length).toBe(3); +expect(result).toEqual({ r: 255, g: 0, b: 0 }); +``` + +### Use Appropriate Matchers + +```typescript +// For floating point comparisons +expect(result).toBeCloseTo(3.14, 2); + +// For object structure +expect(result).toEqual({ start: [0, 0, 0], end: [1, 1, 1] }); + +// For arrays +expect(result).toEqual([[0, 0, 0], [1, 0, 0], [1, 1, 0]]); + +// For instance checks +expect(bitByBit).toBeInstanceOf(BitByBitBase); + +// For function behavior +expect(() => fn()).not.toThrow(); +expect(() => fn()).toThrow(ExpectedError); +``` + +## Include Failure Scenarios + +Every test suite should include tests for failure cases and edge conditions: + +```typescript +describe("error handling", () => { + it("should throw error when input is undefined", () => { + expect(() => service.process(undefined)).toThrow(); + }); + + it("should throw error with specific message for invalid input", () => { + expect(() => service.validate(-1)).toThrow("Value must be positive"); + }); + + it("should handle empty array gracefully", () => { + const result = service.processArray([]); + expect(result).toEqual([]); + }); + + it("should handle null values", () => { + expect(() => service.compute(null)).toThrow(); + }); +}); +``` + +## Test Structure + +### Describe Block Organization + +```typescript +describe("ServiceName unit tests", () => { + let service: ServiceName; + + beforeEach(() => { + service = new ServiceName(); + }); + + describe("Constructor initialization", () => { + it("should create instance", () => { /* ... */ }); + }); + + describe("methodName", () => { + it("should return expected result for valid input", () => { /* ... */ }); + it("should throw for invalid input", () => { /* ... */ }); + it("should handle edge case", () => { /* ... */ }); + }); + + describe("Integration with dependencies", () => { + it("should work with dependency service", () => { /* ... */ }); + }); +}); +``` + +### Test Independence + +Each test should be independent and not rely on state from other tests: + +```typescript +// ✅ Use beforeEach to reset state +beforeEach(() => { + bitByBit = new BitByBitBase(); +}); +``` + +## Mock Factory Functions + +Create helper functions for common test setups in `test-helpers.ts`: + +```typescript +export function createMockContext(): Context { + const mockScene = new MockScene(); + return { + scene: mockScene as unknown as BABYLON.Scene, + engine: null, + havokPlugin: null, + } as unknown as Context; +} + +export function createMockWorkerManagers() { + return { + mockJscadWorkerManager: { /* ... */ } as unknown as JSCADWorkerManager, + mockManifoldWorkerManager: { /* ... */ } as unknown as ManifoldWorkerManager, + mockOccWorkerManager: { /* ... */ } as unknown as OCCTWorkerManager + }; +} +``` + +## Summary Checklist + +- [ ] Test file placed next to source file +- [ ] File named `.test.ts` +- [ ] Reusable mocks in `__mocks__` folder +- [ ] AAA pattern followed (Arrange-Act-Assert) +- [ ] Specific assertions used (not `toBeDefined`, `toBeGreaterThan(0)`) +- [ ] Failure scenarios included +- [ ] `as any` avoided (use typed mocks or `as unknown as Type`) +- [ ] Each test is independent +- [ ] Descriptive test names that explain expected behavior + +## General Unit Testing Best Practices + +### Test One Thing Per Test + +Each test should verify a single behavior. If a test fails, it should be immediately clear what broke. + +```typescript +// ❌ Testing multiple behaviors +it("should create and validate user", () => { + const user = service.create({ name: "John" }); + expect(user.id).toBeDefined(); + expect(service.validate(user)).toBe(true); + expect(service.save(user)).resolves.toBe(true); +}); + +// ✅ Separate tests for each behavior +it("should create user with generated id", () => { /* ... */ }); +it("should validate user successfully", () => { /* ... */ }); +it("should save user to database", () => { /* ... */ }); +``` + +### Descriptive Test Names + +Test names should describe the expected behavior, not the implementation: + +```typescript +// ❌ Implementation-focused names +it("calls calculateDistance", () => { /* ... */ }); +it("returns number", () => { /* ... */ }); + +// ✅ Behavior-focused names +it("should return distance of 5 for 3-4-5 triangle", () => { /* ... */ }); +it("should throw when start point is undefined", () => { /* ... */ }); +``` + +### Avoid Logic in Tests + +Tests should be straightforward without conditionals, loops, or complex logic: + +```typescript +// ❌ Logic in test +it("should process items", () => { + const items = [1, 2, 3]; + let sum = 0; + for (const item of items) { + sum += service.process(item); + } + expect(sum).toBe(6); +}); + +// ✅ Direct assertion +it("should process items and return sum", () => { + const result = service.processAll([1, 2, 3]); + expect(result).toBe(6); +}); +``` + +### Test Boundary Conditions + +Always test edge cases and boundaries: + +- Empty inputs (empty arrays, empty strings) +- Null/undefined values +- Zero values +- Negative numbers +- Maximum/minimum values +- Single element collections + +```typescript +describe("boundary conditions", () => { + it("should handle empty array", () => { /* ... */ }); + it("should handle single element", () => { /* ... */ }); + it("should handle maximum value", () => { /* ... */ }); + it("should handle negative input", () => { /* ... */ }); +}); +``` + +### Keep Tests Fast + +Unit tests should execute quickly: + +- Mock external dependencies (APIs, databases, file system) +- Avoid real network calls +- Use minimal test data +- Avoid unnecessary `setTimeout` or delays + +### Don't Test Implementation Details + +Test the public interface, not private methods or internal state: + +```typescript +// ❌ Testing internal implementation +it("should set internal cache", () => { + service.getData(); + expect(service["_cache"]).toBeDefined(); +}); + +// ✅ Testing observable behavior +it("should return cached data on second call", () => { + const first = service.getData(); + const second = service.getData(); + expect(second).toBe(first); +}); +``` + +### Use Test Fixtures Wisely + +For complex test data, create reusable fixtures: + +```typescript +// In test-helpers.ts or fixtures.ts +export const validUserData = { + name: "Test User", + email: "test@example.com", + age: 25 +}; + +export const invalidUserData = { + name: "", + email: "invalid", + age: -1 +}; +``` + +### Prefer Strict Equality + +Use strict matchers when possible: + +```typescript +// ❌ Loose matching +expect(result == 5).toBe(true); + +// ✅ Strict matching +expect(result).toBe(5); +expect(result).toStrictEqual({ a: 1, b: 2 }); +``` + +### Reset State Between Tests + +Ensure clean state for each test: + +```typescript +describe("StatefulService", () => { + let service: StatefulService; + + beforeEach(() => { + service = new StatefulService(); + jest.clearAllMocks(); + }); + + afterEach(() => { + service.cleanup(); + }); +}); +``` + +### Avoid Test Interdependence + +Tests should pass regardless of execution order. Never rely on: + +- State from previous tests +- Specific test execution order +- Shared mutable data between tests diff --git a/docs/blog/2024-11-08-updated-bitbybit-runners.md b/docs/blog/2024-11-08-updated-bitbybit-runners.md index 55632a84..55c2613e 100644 --- a/docs/blog/2024-11-08-updated-bitbybit-runners.md +++ b/docs/blog/2024-11-08-updated-bitbybit-runners.md @@ -121,7 +121,7 @@ We are serving the Bitbybit Runners from the **JSDelivr CDN**. You can include t ``` -**Note:** You should replace `` with an actual version number (e.g., `0.20.14`). You can find all the official versions of Bitbybit.dev here: +**Note:** You should replace `` with an actual version number (e.g., `0.21.0`). You can find all the official versions of Bitbybit.dev here: ➡️ **[Bitbybit.dev GitHub Releases](https://github.com/bitbybit-dev/bitbybit/releases)** ### Examples of the Runners diff --git a/docs/blog/2026-01-02-ironside-armour-use-case.mdx b/docs/blog/2026-01-02-ironside-armour-use-case.mdx new file mode 100644 index 00000000..a2a07ca4 --- /dev/null +++ b/docs/blog/2026-01-02-ironside-armour-use-case.mdx @@ -0,0 +1,135 @@ +--- +slug: 3d-bits-app-use-case-ironside-armour-gym-configurators-on-shopify +title: "How Ironside Armour Built Complex 60-Part Gym Configurators Without Writing Code" +authors: [ubarevicius] +tags: [bitbybit, 3d-bits, shopify, case-study, fitness-equipment] +description: "Discover how Ironside Armour transformed their Shopify store with interactive 3D gym rack configurators using 3D Bits - no coding required. A real-world case study." +--- + +![Ironside Armour configurators driven by 3D Bits app for Shopify](https://ik.imagekit.io/bitbybit/app/assets/blog/3d-bits-app-use-case-ironside-armour-gym-configurators-on-shopify/ironside-armour-gym-configurators-3d-bits-app-for-shopify.webp "Ironside Armour Rack and landing page with link to configurators.") + +How do you sell a modular gym rack with over 60+ customizable parts online? Static images don't cut it. Videos can only show so much. And asking customers to imagine how different components fit together? That's a recipe for confusion and abandoned carts. + +[Ironside Armour](https://ironsidearmour.com), a global fitness equipment company, faced exactly this challenge. Through close collaboration with our team, they developed interactive 3D configurators powered by 3D Bits - a rewarding journey that transformed how their customers shop. + + + +## The Challenge: Selling Complex Modular Products Online + +Ironside Armour designs and sells premium gym racks that customers can customize to their exact needs. We're talking about products with **60+ individual parts** that can be combined in countless configurations. Try explaining that with a product gallery. + +When customers shop for modular gym equipment, they need to: +- Visualize exactly what they're buying +- Understand how parts connect and interact +- Feel confident their configuration will work +- Know the total price before checkout + +Traditional e-commerce approaches simply couldn't deliver this experience. That's where 3D configurators became the obvious solution. + +
+ +
+ +Today, Ironside Armour offers three fully interactive 3D configurators on their Shopify store: + +- [Pro Power Rack](https://ironsidearmour.com/en/products/pro-power-rack) +- [Pro Half Rack](https://ironsidearmour.com/en/products/pro-half-rack) +- [Pro Foldable Rack](https://ironsidearmour.com/en/products/pro-foldable-rack) + +Each configurator lets customers build their perfect rack, see it from every angle, and add it to cart with accurate pricing - all in real time. + +## Why 3D Bits Was the Right Choice + +### A Collaborative Approach to Complex Configurators + +These aren't simple "pick a color" configurators. Each gym rack includes **60+ parts** with various attachment points, accessories, and configuration options. Building something this sophisticated required close collaboration between Ironside Armour and our team. + +Using our visual [**Viewer Editor**](/learn/getting-started/viewer-editor/intro), we worked together to define parts, set up the configuration logic, and connect everything to their Shopify products. The Viewer Editor provides a powerful interface for building sophisticated product configurators without writing code - but that doesn't mean the process is trivial. Complex products require thoughtful planning, proper 3D model preparation, and attention to detail. + +![No-Code Viewer Editor For 3D Product Configurators](https://ik.imagekit.io/bitbybit/app/assets/blog/3d-bits-app-use-case-ironside-armour-gym-configurators-on-shopify/ironside-armour-3d-bits-viewer-editor-no-code-configurators-gltf.webp "Ironside Armour Rack configurator inside Viewer Editor, included inside 3D Bits app for Shopify") + +### Seamless Third-Party Integration + +One of 3D Bits' core strengths is flexibility. Rather than forcing merchants into a rigid ecosystem, we built the app to integrate with the tools you already use. + +Ironside Armour chose to pair 3D Bits with [YMQ Options](https://apps.shopify.com/ymq-options), a popular product options app they were already familiar with. This combination gave them: +- Complex pricing logic for modular products +- Custom option handling beyond Shopify's variant limits +- A familiar workflow for managing product options + +This modular approach - where you combine specialized apps like puzzle pieces - is quite unique in the industry. Want to use a different pricing app? Go ahead. Need to code a custom solution? We support that too. 3D Bits focuses on what it does best (high-performance 3D rendering) while integrating seamlessly with your existing stack. [Learn more about compatible apps](/learn/3d-bits/tutorials/getting-started/apps-for-3d-bits). + +## From CAD to Web: Optimizing 3D Models + +Like many manufacturers, Ironside Armour's 3D models originated as STEP files - the industry standard for professional CAD. But CAD models aren't built for web performance. They're built for engineering precision. + +We worked closely with Ironside Armour to transform their production models into web-optimized GLTF files. This process involved: + +- **Mesh optimization** - Reducing polygon counts while maintaining visual quality +- **Texture compression** - Balancing file size with crisp, realistic materials +- **Instanced loading** - A key 3D Bits feature where duplicate parts load only once and render in multiple positions at the GPU level, dramatically improving performance + +We provided hands-on support and consulting during the initial setup. Ironside Armour also generously allowed us to use their actual production models in our tutorials, helping other merchants learn the optimization process. + +
+ +
+ +## Long-Term Success: Growing Capabilities + +Our collaboration with Ironside Armour didn't end after the initial setup - it evolved. We provided extensive support during the learning curve, and over time, they developed the expertise to manage and extend their configurators independently. + +Since our initial work together, Ironside Armour has: +- Switched Shopify themes (3D Bits kept working seamlessly) +- Made multiple updates to their option app configuration +- Added new configurable parts to their configurators + +Today, they confidently optimize their own 3D models, extend their configurators with new components, and maintain complex product catalogs. **This is the outcome we aim for with every client: building your capabilities through partnership, so you can grow with confidence.** + +## What Ironside Armour Says + +
+ +### "I wasn't expecting to be this impressed. This guy delivers real value with authenticity, quality, and professionalism. Every interaction we've had has been smooth, straightforward, and reliable. What you see is exactly what you get - just solid, well-executed work with no unnecessary noise. This is the kind of service I'd recommend without hesitation. I'll definitely continue working with Matas." + +**Francesco, Founder & CEO** +[![Ironside Armour](https://ik.imagekit.io/bitbybit/app/assets/start/shopify/ironside-armour.webp)](https://ironsidearmour.com) + +
+ +## Key Takeaways + +If you're selling complex, modular, or customizable products on Shopify, here's what Ironside Armour's experience demonstrates: + +1. **Collaboration is key** - Complex configurators benefit from working closely with experienced partners who understand both the technology and the challenges +2. **Flexibility matters** - Choose apps that work with your existing stack, not against it +3. **Invest in optimization** - Properly converted 3D models make all the difference in performance +4. **The journey is rewarding** - While building sophisticated 3D configurators requires effort and planning, the results transform how customers experience your products + +## Ready to Start Your Journey? + +As we continue developing 3D Bits, every improvement benefits all our merchants. Performance enhancements, new features, and expanded capabilities automatically become available to stores like Ironside Armour. + +Building a 3D configurator for complex products is a rewarding path - but you don't have to figure it out alone. Our **Pro plan** includes premium support with direct access to our team, helping you overcome challenges and make the most of the platform. [Learn more about our plans](/learn/3d-bits/plans/subscription-plans). + +Depending on your project's needs, we may also offer additional services - from 3D model optimization to hands-on configurator setup - to ensure your journey is a success. Every client is different, and we're committed to finding the right level of support for your situation. + +**If you're considering 3D configurators for your Shopify store and don't know where to start, [reach out to us](mailto:info@bitbybit.dev).** We're here to help you navigate this journey, just as we did with Ironside Armour. + +[Get started with 3D Bits](https://apps.shopify.com/3d-bits-1) \ No newline at end of file diff --git a/docs/blog/tags.yml b/docs/blog/tags.yml index be23b741..08c22079 100644 --- a/docs/blog/tags.yml +++ b/docs/blog/tags.yml @@ -26,4 +26,24 @@ xr: vr: label: VR permalink: /vr - description: Blogs about Virtual Reality \ No newline at end of file + description: Blogs about Virtual Reality + +3d-bits: + label: 3D Bits + permalink: /3d-bits + description: Blog posts about 3D Bits app for Shopify and its use cases + +shopify: + label: Shopify + permalink: /shopify + description: Blogs about Shopify integrations via 3D Bits app + +case-study: + label: Case Study + permalink: /case-study + description: Case studies related to Bitbybit, 3D Bits and Shopify + +fitness-equipment: + label: Fitness Equipment + permalink: /fitness-equipment + description: Blogs about fitness equipment industry and 3D visualization \ No newline at end of file diff --git a/docs/learn/3d-bits/theme-app-extensions/bitbybit-viewer.md b/docs/learn/3d-bits/theme-app-extensions/bitbybit-viewer.md index ab888e1c..c9addb4e 100644 --- a/docs/learn/3d-bits/theme-app-extensions/bitbybit-viewer.md +++ b/docs/learn/3d-bits/theme-app-extensions/bitbybit-viewer.md @@ -110,7 +110,7 @@ Save your JSON configurator as a file, upload it to Shopify CDN as a file. Copy While our Viewer Editor is the recommended way to create and manage the Scene Config JSON, you can also edit the JSON directly using any text editor. For a better editing experience with features like syntax highlighting and autocompletion (intellisense), we provide a JSON schema. -* **JSON Schema:** You can find the schema [here](https://app-store.bitbybit.dev/files/ecommerce/viewer-editor/viewer-scene-schema-v0.20.14.json). (Note: This schema link points to version `0.20.14`. The schema may be updated in the future, so ensure you refer to the latest version compatible with your "3D Bits" app version.) +* **JSON Schema:** You can find the schema [here](https://app-store.bitbybit.dev/files/ecommerce/viewer-editor/viewer-scene-schema-v0.21.0.json). (Note: This schema link points to version `0.21.0`. The schema may be updated in the future, so ensure you refer to the latest version compatible with your "3D Bits" app version.) Many modern code editors (like VS Code) can use this schema to provide validation and autocompletion as you edit the JSON. ## Video Tutorial: BITBYBIT VIEWER Block Setup diff --git a/docs/learn/3d-bits/tutorials/bitbybit-viewer/settings.md b/docs/learn/3d-bits/tutorials/bitbybit-viewer/settings.md index b3f53de2..8e973a47 100644 --- a/docs/learn/3d-bits/tutorials/bitbybit-viewer/settings.md +++ b/docs/learn/3d-bits/tutorials/bitbybit-viewer/settings.md @@ -203,7 +203,7 @@ The system automatically detects if you're providing a URL (starting with `http: - For complex configurations, use a URL to an external JSON file - it keeps your theme settings cleaner and makes updates easier - Use the Viewer Editor to generate valid configurations - Test your scene configuration thoroughly before going live -- The scene configuration follows a [JSON schema](https://app-store.bitbybit.dev/files/ecommerce/viewer-editor/viewer-scene-schema-v0.20.14.json) that defines all available options +- The scene configuration follows a [JSON schema](https://app-store.bitbybit.dev/files/ecommerce/viewer-editor/viewer-scene-schema-v0.21.0.json) that defines all available options ::: --- diff --git a/docs/learn/3d-bits/tutorials/getting-started/common-settings.md b/docs/learn/3d-bits/tutorials/getting-started/common-settings.md index 2143c3ec..0391a967 100644 --- a/docs/learn/3d-bits/tutorials/getting-started/common-settings.md +++ b/docs/learn/3d-bits/tutorials/getting-started/common-settings.md @@ -121,7 +121,7 @@ These settings are specific to RUNNER and APPS blocks: ### Runner CDN Link **Available in:** VIEWER, RUNNER -**Default:** `https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.20.14/runner/bitbybit-runner-babylonjs.js` +**Default:** `https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.21.0/runner/bitbybit-runner-babylonjs.js` Specifies which version of the Bitbybit runner library to use. The runner is the core engine that loads and renders 3D content in your browser. @@ -173,7 +173,7 @@ The URL follows this pattern: https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@{VERSION}/runner/bitbybit-runner-babylonjs.js ``` -Replace `{VERSION}` with the desired version number (e.g., `0.20.14`). +Replace `{VERSION}` with the desired version number (e.g., `0.21.0`). **Self-Hosting on Shopify CDN:** diff --git a/docs/learn/3d-bits/tutorials/videos-tutorials/product-customizable-text.mdx b/docs/learn/3d-bits/tutorials/videos-tutorials/product-customizable-text.mdx index b8aa2bbd..05c20137 100644 --- a/docs/learn/3d-bits/tutorials/videos-tutorials/product-customizable-text.mdx +++ b/docs/learn/3d-bits/tutorials/videos-tutorials/product-customizable-text.mdx @@ -153,7 +153,7 @@ To save you time, here is the embedded Bitbybit Rete script used in this tutoria diff --git a/docs/learn/3d-bits/tutorials/videos-tutorials/product-laptop-holder.mdx b/docs/learn/3d-bits/tutorials/videos-tutorials/product-laptop-holder.mdx index 91134c04..4ae80933 100644 --- a/docs/learn/3d-bits/tutorials/videos-tutorials/product-laptop-holder.mdx +++ b/docs/learn/3d-bits/tutorials/videos-tutorials/product-laptop-holder.mdx @@ -63,7 +63,7 @@ To save you time and provide a starting point, here is the embedded Bitbybit Typ {\n\n laptops.forEach(laptop => {\n laptop.center = [0, laptop.height / 2 + laptopLiftedHeight, 0] as Bit.Inputs.Base.Point3;\n });\n\n let laptopFillets = [];\n let totalDistance = 0;\n let previousLaptopLength = 0;\n\n laptops.forEach(async (laptop, index) => {\n totalDistance += distanceBetweenLaptops + laptop.length / 2 + previousLaptopLength / 2;\n previousLaptopLength = laptop.length;\n laptop.center[2] = totalDistance;\n const laptopBaseModel = await bitbybit.occt.shapes.solid.createBox({\n width: laptop.width,\n length: laptop.length,\n height: laptop.height,\n center: laptop.center\n });\n const laptopFillet = await bitbybit.occt.fillets.filletEdges({ shape: laptopBaseModel, indexes: undefined, radius: 0.2 });\n laptopFillets.push(laptopFillet);\n\n const laptopVisModel = await bitbybit.occt.shapes.solid.createBox({\n width: laptop.width,\n length: laptop.length - 0.01,\n height: laptop.height,\n center: laptop.center\n });\n const laptopVisFillet = await bitbybit.occt.fillets.filletEdges({ shape: laptopVisModel, indexes: undefined, radius: 0.2 });\n laptopFillets.push(laptopFillet);\n\n const di = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n\n di.faceOpacity = 0.2;\n di.edgeWidth = 5;\n di.edgeOpacity = 0.6;\n di.edgeColour = whiteColor;\n di.faceColour = whiteColor;\n const laptopFilletMesh = await bitbybit.draw.drawAnyAsync({ entity: laptopVisFillet, options: di });\n laptopsFilletsMesh.push(laptopFilletMesh);\n })\n\n const polygonWire = await bitbybit.occt.shapes.wire.createPolygonWire({\n points: controlPoints\n });\n const extrusion = await bitbybit.occt.operations.extrude({\n shape: polygonWire, direction: [0, 0, totalDistance += distanceBetweenLaptops + previousLaptopLength / 2]\n });\n const laptopStandFillet = await bitbybit.occt.fillets.filletEdges({ shape: extrusion, indexes: undefined, radius: 1 });\n const laptopStandThick = await bitbybit.occt.operations.makeThickSolidSimple({ shape: laptopStandFillet, offset: -0.5 });\n\n laptopStand = await bitbybit.occt.booleans.difference({ shape: laptopStandThick, shapes: laptopFillets, keepEdges: false });\n const li = new Bit.Inputs.OCCT.DrawShapeDto(laptopStand);\n li.faceOpacity = 1;\n if (flipColor) {\n li.faceColour = \"#0000ff\";\n li.edgeColour = whiteColor;\n } else {\n li.faceColour = holderColor;\n li.edgeColour = whiteColor;\n }\n li.edgeWidth = 5;\n laptopStandMesh = await bitbybit.draw.drawAnyAsync({ entity: laptopStand, options: li });\n const laptopsMeshes = await Promise.all(laptopsFilletsMesh);\n return [laptopStandMesh, ...laptopsMeshes];\n }\n\n const meshes = await renderLaptops(laptops);\n return { meshes };\n}\n\nclass Laptop {\n width: number;\n length: number;\n height: number;\n center?: Bit.Inputs.Base.Point3;\n}\n\nBit.setBitbybitRunnerResult(start());","version":"0.20.14","type":"typescript"}} + script={{"script":"Bit.mockBitbybitRunnerInputs({\n \"Laptop Type\": \"MacBook Pro 16\",\n \"Number Laptops\": \"3\",\n \"Color\": \"Black\",\n});\nconst inputs = Bit.getBitbybitRunnerInputs();\n\nconst laptops: Laptop[] = []\n\nlet laptop: Laptop;\n\nswitch (inputs[\"Laptop Type\"]) {\n case \"MacBook Pro 16\":\n laptop = {\n length: 1.63,\n width: 35.8,\n height: 24.6\n };\n break;\n case \"MacBook Pro 14\":\n laptop = {\n length: 1.57,\n width: 31.3,\n height: 22.2\n }\n break;\n case \"MacBook Air\":\n laptop = {\n length: 1.2,\n width: 30.5,\n height: 21.6\n }\n break;\n default:\n break;\n}\n\nlet flipColor = false;\nswitch (inputs[\"Color\"]) {\n case \"Blue\":\n flipColor = true;\n break;\n default:\n break;\n}\n\nconsole.log(\"laptop \", laptop);\n\nconst nrLaptops = +inputs[\"Number Laptops\"];\n\nfor (let i = 0; i < nrLaptops; i++) {\n laptops.push({ ...laptop });\n}\n\nconst whiteColor = \"#ffffff\";\nconst holderColor = \"#333333\";\n\nconst laptopLiftedHeight = 3;\nconst distanceBetweenLaptops = 1.7;\nconst exportSTEP = false;\n\nbitbybit.babylon.scene.backgroundColour({ colour: \"#bbbbbb\" });\n\nconst pointLightConf = new Bit.Inputs.BabylonScene.PointLightDto();\npointLightConf.position = [-15, 20, -5];\npointLightConf.intensity = 8000;\npointLightConf.diffuse = \"#3333ff\";\npointLightConf.radius = 0;\nbitbybit.babylon.scene.drawPointLight(pointLightConf);\n\nconst controlPoints = [\n [-12.5, 0, 0],\n [-8, 13, 0],\n [-4, 11, 0],\n [-2, 6, 0],\n [2, 6, 0],\n [4, 14, 0],\n [8, 17, 0],\n [12.5, 0, 0]\n] as Bit.Inputs.Base.Point3[];\n\nlet laptopStand;\nlet laptopStandMesh;\n\nconst laptopsFilletsMesh = [];\n\nasync function start() {\n const ground = await bitbybit.occt.shapes.face.createCircleFace({ center: [0, 0, 0], direction: [0, 1, 0], radius: 75, });\n const groundOptions = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n groundOptions.faceColour = whiteColor;\n groundOptions.drawEdges = false;\n await bitbybit.draw.drawAnyAsync({ entity: ground, options: groundOptions });\n\n const renderLaptops = async (laptops) => {\n\n laptops.forEach(laptop => {\n laptop.center = [0, laptop.height / 2 + laptopLiftedHeight, 0] as Bit.Inputs.Base.Point3;\n });\n\n let laptopFillets = [];\n let totalDistance = 0;\n let previousLaptopLength = 0;\n\n laptops.forEach(async (laptop, index) => {\n totalDistance += distanceBetweenLaptops + laptop.length / 2 + previousLaptopLength / 2;\n previousLaptopLength = laptop.length;\n laptop.center[2] = totalDistance;\n const laptopBaseModel = await bitbybit.occt.shapes.solid.createBox({\n width: laptop.width,\n length: laptop.length,\n height: laptop.height,\n center: laptop.center\n });\n const laptopFillet = await bitbybit.occt.fillets.filletEdges({ shape: laptopBaseModel, indexes: undefined, radius: 0.2 });\n laptopFillets.push(laptopFillet);\n\n const laptopVisModel = await bitbybit.occt.shapes.solid.createBox({\n width: laptop.width,\n length: laptop.length - 0.01,\n height: laptop.height,\n center: laptop.center\n });\n const laptopVisFillet = await bitbybit.occt.fillets.filletEdges({ shape: laptopVisModel, indexes: undefined, radius: 0.2 });\n laptopFillets.push(laptopFillet);\n\n const di = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n\n di.faceOpacity = 0.2;\n di.edgeWidth = 5;\n di.edgeOpacity = 0.6;\n di.edgeColour = whiteColor;\n di.faceColour = whiteColor;\n const laptopFilletMesh = await bitbybit.draw.drawAnyAsync({ entity: laptopVisFillet, options: di });\n laptopsFilletsMesh.push(laptopFilletMesh);\n })\n\n const polygonWire = await bitbybit.occt.shapes.wire.createPolygonWire({\n points: controlPoints\n });\n const extrusion = await bitbybit.occt.operations.extrude({\n shape: polygonWire, direction: [0, 0, totalDistance += distanceBetweenLaptops + previousLaptopLength / 2]\n });\n const laptopStandFillet = await bitbybit.occt.fillets.filletEdges({ shape: extrusion, indexes: undefined, radius: 1 });\n const laptopStandThick = await bitbybit.occt.operations.makeThickSolidSimple({ shape: laptopStandFillet, offset: -0.5 });\n\n laptopStand = await bitbybit.occt.booleans.difference({ shape: laptopStandThick, shapes: laptopFillets, keepEdges: false });\n const li = new Bit.Inputs.OCCT.DrawShapeDto(laptopStand);\n li.faceOpacity = 1;\n if (flipColor) {\n li.faceColour = \"#0000ff\";\n li.edgeColour = whiteColor;\n } else {\n li.faceColour = holderColor;\n li.edgeColour = whiteColor;\n }\n li.edgeWidth = 5;\n laptopStandMesh = await bitbybit.draw.drawAnyAsync({ entity: laptopStand, options: li });\n const laptopsMeshes = await Promise.all(laptopsFilletsMesh);\n return [laptopStandMesh, ...laptopsMeshes];\n }\n\n const meshes = await renderLaptops(laptops);\n return { meshes };\n}\n\nclass Laptop {\n width: number;\n length: number;\n height: number;\n center?: Bit.Inputs.Base.Point3;\n}\n\nBit.setBitbybitRunnerResult(start());","version":"0.21.0","type":"typescript"}} title="Bitbybit Rete Editor - 3D Laptop Holder" description="3D Laptop holder configurator" /> diff --git a/docs/learn/3d-bits/tutorials/videos-tutorials/product-palm-table.mdx b/docs/learn/3d-bits/tutorials/videos-tutorials/product-palm-table.mdx index 221fad79..061ae5b7 100644 --- a/docs/learn/3d-bits/tutorials/videos-tutorials/product-palm-table.mdx +++ b/docs/learn/3d-bits/tutorials/videos-tutorials/product-palm-table.mdx @@ -157,7 +157,7 @@ To save you time, here is the embedded Rete script used in this tutorial for the diff --git a/docs/learn/code/common/base/color/color-usage-examples.md b/docs/learn/code/common/base/color/color-usage-examples.md index 3378a053..0dcde0d1 100644 --- a/docs/learn/code/common/base/color/color-usage-examples.md +++ b/docs/learn/code/common/base/color/color-usage-examples.md @@ -48,21 +48,21 @@ Click through the tabs below to see the implementation. You can interact with th colorParamfaceColoredgeColorcolorParam0faceColorcolorParam255colorParam0255edgeColor#0000ff6000TRUE0.01TRUEfaceColorTRUEedgeColor10","version":"0.20.14","type":"blockly"}} + script={{"script":"colorParamfaceColoredgeColorcolorParam0faceColorcolorParam255colorParam0255edgeColor#0000ff6000TRUE0.01TRUEfaceColorTRUEedgeColor10","version":"0.21.0","type":"blockly"}} title="Color Usage Example" /> {\n\n const colorParam = 55;\n const rgbToHexOptions = new Bit.Inputs.Color.RGBMinMaxDto();\n rgbToHexOptions.r = colorParam;\n rgbToHexOptions.b = colorParam;\n const faceColor = bitbybit.color.rgbToHex(rgbToHexOptions);\n\n // This might look strange as you could just assign the string to edgeColor directly, \n // but this identity function is nice to have in visual prgramming editors - check Rete & Blockly\n // examples\n \n const edgeColor = bitbybit.color.hexColor({ color: \"#ff0000\" });\n\n const cubeOptions = new Bit.Inputs.OCCT.CubeDto();\n cubeOptions.size = 6;\n const cube = await bitbybit.occt.shapes.solid.createCube(cubeOptions);\n\n const drawOpt = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n drawOpt.faceColour = faceColor;\n drawOpt.edgeColour = edgeColor;\n drawOpt.edgeWidth = 10;\n bitbybit.draw.drawAnyAsync({ entity: cube, options: drawOpt });\n}\n\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = async () => {\n\n const colorParam = 55;\n const rgbToHexOptions = new Bit.Inputs.Color.RGBMinMaxDto();\n rgbToHexOptions.r = colorParam;\n rgbToHexOptions.b = colorParam;\n const faceColor = bitbybit.color.rgbToHex(rgbToHexOptions);\n\n // This might look strange as you could just assign the string to edgeColor directly, \n // but this identity function is nice to have in visual prgramming editors - check Rete & Blockly\n // examples\n \n const edgeColor = bitbybit.color.hexColor({ color: \"#ff0000\" });\n\n const cubeOptions = new Bit.Inputs.OCCT.CubeDto();\n cubeOptions.size = 6;\n const cube = await bitbybit.occt.shapes.solid.createCube(cubeOptions);\n\n const drawOpt = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n drawOpt.faceColour = faceColor;\n drawOpt.edgeColour = edgeColor;\n drawOpt.edgeWidth = 10;\n bitbybit.draw.drawAnyAsync({ entity: cube, options: drawOpt });\n}\n\nstart();","version":"0.21.0","type":"typescript"}} title="Color Usage Example" /> diff --git a/docs/learn/code/common/base/point/point-hex-grid-example.md b/docs/learn/code/common/base/point/point-hex-grid-example.md index 6af826a0..d804f410 100644 --- a/docs/learn/code/common/base/point/point-hex-grid-example.md +++ b/docs/learn/code/common/base/point/point-hex-grid-example.md @@ -55,21 +55,21 @@ Click through the tabs below to see the implementation. Each example will genera hexagonspointshexCornershexPolylinesihexagons20101010FALSEFALSEFALSEFALSEFALSETRUEFALSEpointshexagonscentershexCornershexagonshexagonshexPolylinesihexCornersINSERTLASThexPolylinesiTRUEpointshexPolylines","version":"0.20.14","type":"blockly"}} + script={{"script":"hexagonspointshexCornershexPolylinesihexagons20101010FALSEFALSEFALSEFALSEFALSETRUEFALSEpointshexagonscentershexCornershexagonshexagonshexPolylinesihexCornersINSERTLASThexPolylinesiTRUEpointshexPolylines","version":"0.21.0","type":"blockly"}} title="Point Hex Grid Example" /> {\n\n // 1. Configure the hexagonal grid options\n const hexOptions = new Bit.Inputs.Point.HexGridScaledToFitDto();\n // Set options different from defaults. \n // TypeScript IntelliSense (e.g., typing \"hexOptions.\") will show all available parameters.\n hexOptions.width = 20;\n hexOptions.height = 10;\n hexOptions.nrHexagonsInWidth = 10;\n hexOptions.nrHexagonsInHeight = 10;\n hexOptions.centerGrid = true; // Center the entire grid at the world origin [0,0,0]\n // Example: hexOptions.flatTop = true; // To get flat-topped hexagons\n // Example: hexOptions.pointsOnGround = true; // To project to XZ plane if original is XY\n\n // 2. Generate the hex grid data\n // This function returns an object like: \n // { centers: Point3[], hexagons: Point3[][], shortestDistEdge, longestDistEdge, maxFilletRadius }\n const hexResult = bitbybit.point.hexGridScaledToFit(hexOptions);\n\n // 3. Create polylines for each hexagon's outline\n // hexResult.hexagons is a list of lists (e.g., [[v1,v2..v6 for hex1], [v1,v2..v6 for hex2], ...])\n // We .map() over this list to create a Polyline object for each hexagon.\n const polylines = hexResult.hexagons.map(singleHexagonCornerPoints => {\n const polylineOptions = new Bit.Inputs.Polyline.PolylineCreateDto();\n polylineOptions.points = singleHexagonCornerPoints; // The 6 corner points\n polylineOptions.isClosed = true; // Ensure the polyline forms a closed loop\n return bitbybit.polyline.create(polylineOptions);\n }) as Bit.Inputs.Base.Polyline3[]; // Type assertion: the result is an array of Polyline3 objects\n\n // 4. Draw the center points of the hexagons\n // hexResult.centers is a list of 3D points: [[cx1,cy1,cz1], [cx2,cy2,cz2], ...]\n bitbybit.draw.drawAnyAsync({ entity: hexResult.centers });\n\n // 5. Draw the polylines representing the hexagon outlines\n bitbybit.draw.drawAnyAsync({ entity: polylines });\n\n}\n\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = () => {\n\n // 1. Configure the hexagonal grid options\n const hexOptions = new Bit.Inputs.Point.HexGridScaledToFitDto();\n // Set options different from defaults. \n // TypeScript IntelliSense (e.g., typing \"hexOptions.\") will show all available parameters.\n hexOptions.width = 20;\n hexOptions.height = 10;\n hexOptions.nrHexagonsInWidth = 10;\n hexOptions.nrHexagonsInHeight = 10;\n hexOptions.centerGrid = true; // Center the entire grid at the world origin [0,0,0]\n // Example: hexOptions.flatTop = true; // To get flat-topped hexagons\n // Example: hexOptions.pointsOnGround = true; // To project to XZ plane if original is XY\n\n // 2. Generate the hex grid data\n // This function returns an object like: \n // { centers: Point3[], hexagons: Point3[][], shortestDistEdge, longestDistEdge, maxFilletRadius }\n const hexResult = bitbybit.point.hexGridScaledToFit(hexOptions);\n\n // 3. Create polylines for each hexagon's outline\n // hexResult.hexagons is a list of lists (e.g., [[v1,v2..v6 for hex1], [v1,v2..v6 for hex2], ...])\n // We .map() over this list to create a Polyline object for each hexagon.\n const polylines = hexResult.hexagons.map(singleHexagonCornerPoints => {\n const polylineOptions = new Bit.Inputs.Polyline.PolylineCreateDto();\n polylineOptions.points = singleHexagonCornerPoints; // The 6 corner points\n polylineOptions.isClosed = true; // Ensure the polyline forms a closed loop\n return bitbybit.polyline.create(polylineOptions);\n }) as Bit.Inputs.Base.Polyline3[]; // Type assertion: the result is an array of Polyline3 objects\n\n // 4. Draw the center points of the hexagons\n // hexResult.centers is a list of 3D points: [[cx1,cy1,cz1], [cx2,cy2,cz2], ...]\n bitbybit.draw.drawAnyAsync({ entity: hexResult.centers });\n\n // 5. Draw the polylines representing the hexagon outlines\n bitbybit.draw.drawAnyAsync({ entity: polylines });\n\n}\n\nstart();","version":"0.21.0","type":"typescript"}} title="Point Hex Grid Example" /> diff --git a/docs/learn/code/common/base/point/point-spiral-examples.md b/docs/learn/code/common/base/point/point-spiral-examples.md index 40d1d89e..20ce680d 100644 --- a/docs/learn/code/common/base/point/point-spiral-examples.md +++ b/docs/learn/code/common/base/point/point-spiral-examples.md @@ -45,21 +45,21 @@ Click through the tabs below to see the implementation. Each example will genera 0.9300361","version":"0.20.14","type":"blockly"}} + script={{"script":"0.9300361","version":"0.21.0","type":"blockly"}} title="Point Spiral Example" /> {\n\n // 1. Configure the spiral parameters\n const spiralOptions = new Bit.Inputs.Point.SpiralDto();\n spiralOptions.numberPoints = 300;\n spiralOptions.radius = 6; // Overall extent of the spiral; default is 1\n spiralOptions.widening = 3; // Controls how tight the spiral is; default is 10\n spiralOptions.phi = 0.9; // Constant influencing the spiral pattern; default relates to Golden Angle\n spiralOptions.factor = 1; // General scaling factor; default is 1\n\n // 2. Generate the list of points forming the spiral\n // The bitbybit.point.spiral() function returns an array of 3D points.\n const points = bitbybit.point.spiral(spiralOptions);\n\n // 3. Draw the generated points in the scene\n // The drawAnyAsync function can take an array of points and will render them.\n bitbybit.draw.drawAnyAsync({ entity: points });\n\n}\n\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = () => {\n\n // 1. Configure the spiral parameters\n const spiralOptions = new Bit.Inputs.Point.SpiralDto();\n spiralOptions.numberPoints = 300;\n spiralOptions.radius = 6; // Overall extent of the spiral; default is 1\n spiralOptions.widening = 3; // Controls how tight the spiral is; default is 10\n spiralOptions.phi = 0.9; // Constant influencing the spiral pattern; default relates to Golden Angle\n spiralOptions.factor = 1; // General scaling factor; default is 1\n\n // 2. Generate the list of points forming the spiral\n // The bitbybit.point.spiral() function returns an array of 3D points.\n const points = bitbybit.point.spiral(spiralOptions);\n\n // 3. Draw the generated points in the scene\n // The drawAnyAsync function can take an array of points and will render them.\n bitbybit.draw.drawAnyAsync({ entity: points });\n\n}\n\nstart();","version":"0.21.0","type":"typescript"}} title="Point Spiral Example" /> diff --git a/docs/learn/code/common/base/text/text-usage-examples.md b/docs/learn/code/common/base/text/text-usage-examples.md index ad41e6ad..1cb4fbdf 100644 --- a/docs/learn/code/common/base/text/text-usage-examples.md +++ b/docs/learn/code/common/base/text/text-usage-examples.md @@ -53,21 +53,21 @@ Click through the tabs below to see the implementation. Each example will create namewordwordListnameJohnwordawesomewordListnamewordHi {0}, you are {1}!wordList'Roboto''Regular'20.2180000010'centerMiddle'","version":"0.20.14","type":"blockly"}} + script={{"script":"namewordwordListnameJohnwordawesomewordListnamewordHi {0}, you are {1}!wordList'Roboto''Regular'20.2180000010'centerMiddle'","version":"0.21.0","type":"blockly"}} title="Text Formatting And 3D Fonts" /> {\n const name = \"John\";\n const word = \"awesome\";\n\n const formatOpt = new Bit.Inputs.Text.TextFormatDto();\n formatOpt.text = \"Hi {0}, you are {1}!\";\n formatOpt.values = [name, word];\n const formattedText = bitbybit.text.format(formatOpt);\n\n const text3dOptions = new Bit.Advanced.Text3D.Text3DDto();\n text3dOptions.text = formattedText;\n text3dOptions.rotation = 180;\n text3dOptions.fontSize = 2;\n const text3d = await bitbybit.advanced.text3d.create(text3dOptions);\n bitbybit.draw.drawAnyAsync({ entity: text3d });\n}\n\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = async () => {\n const name = \"John\";\n const word = \"awesome\";\n\n const formatOpt = new Bit.Inputs.Text.TextFormatDto();\n formatOpt.text = \"Hi {0}, you are {1}!\";\n formatOpt.values = [name, word];\n const formattedText = bitbybit.text.format(formatOpt);\n\n const text3dOptions = new Bit.Advanced.Text3D.Text3DDto();\n text3dOptions.text = formattedText;\n text3dOptions.rotation = 180;\n text3dOptions.fontSize = 2;\n const text3d = await bitbybit.advanced.text3d.create(text3dOptions);\n bitbybit.draw.drawAnyAsync({ entity: text3d });\n}\n\nstart();","version":"0.21.0","type":"typescript"}} title="Text Formatting And 3D Fonts" /> diff --git a/docs/learn/code/common/base/vector/vector-usage-examples.md b/docs/learn/code/common/base/vector/vector-usage-examples.md index 89fb25ae..6a8072c8 100644 --- a/docs/learn/code/common/base/vector/vector-usage-examples.md +++ b/docs/learn/code/common/base/vector/vector-usage-examples.md @@ -60,21 +60,21 @@ Click through the tabs below to see the implementation in Rete, Blockly, and Typ spanItemsspanEaseItemsvectorsj40040010100.450.50.5FALSE#ffffff#ffffffspanItems0.205spanEaseItemsspanItems05'easeInSine'FALSEvectorsj1spanItems1INSERTLASTvectorsGETFROM_STARTspanItemsjGETFROM_STARTspanEaseItemsj0vectorsvectors","version":"0.20.14","type":"blockly"}} + script={{"script":"spanItemsspanEaseItemsvectorsj40040010100.450.50.5FALSE#ffffff#ffffffspanItems0.205spanEaseItemsspanItems05'easeInSine'FALSEvectorsj1spanItems1INSERTLASTvectorsGETFROM_STARTspanItemsjGETFROM_STARTspanEaseItemsj0vectorsvectors","version":"0.21.0","type":"blockly"}} title="Vector Span & Ease In Combination" /> {\n\n const spanOptions = new Bit.Inputs.Vector.SpanDto();\n spanOptions.step = 0.2;\n spanOptions.min = 0;\n spanOptions.max = 5;\n const spanItems = bitbybit.vector.span(spanOptions);\n\n const spanEaseOptions = new Bit.Inputs.Vector.SpanEaseItemsDto();\n spanEaseOptions.ease = Bit.Inputs.Math.easeEnum.easeInSine;\n spanEaseOptions.min = 0;\n spanEaseOptions.max = 5;\n spanEaseOptions.nrItems = spanItems.length;\n const spanEaseItems = bitbybit.vector.spanEaseItems(spanEaseOptions);\n\n const vectors = spanItems.map((s, index) => [s, spanEaseItems[index], 0]) as Bit.Inputs.Base.Vector3[];\n\n bitbybit.draw.drawGridMesh(new Bit.Inputs.Draw.SceneDrawGridMeshDto());\n bitbybit.draw.drawAnyAsync({ entity: vectors });\n\n}\n\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = () => {\n\n const spanOptions = new Bit.Inputs.Vector.SpanDto();\n spanOptions.step = 0.2;\n spanOptions.min = 0;\n spanOptions.max = 5;\n const spanItems = bitbybit.vector.span(spanOptions);\n\n const spanEaseOptions = new Bit.Inputs.Vector.SpanEaseItemsDto();\n spanEaseOptions.ease = Bit.Inputs.Math.easeEnum.easeInSine;\n spanEaseOptions.min = 0;\n spanEaseOptions.max = 5;\n spanEaseOptions.nrItems = spanItems.length;\n const spanEaseItems = bitbybit.vector.spanEaseItems(spanEaseOptions);\n\n const vectors = spanItems.map((s, index) => [s, spanEaseItems[index], 0]) as Bit.Inputs.Base.Vector3[];\n\n bitbybit.draw.drawGridMesh(new Bit.Inputs.Draw.SceneDrawGridMeshDto());\n bitbybit.draw.drawAnyAsync({ entity: vectors });\n\n}\n\nstart();","version":"0.21.0","type":"typescript"}} title="Vector Span & Ease In Combination" /> diff --git a/docs/learn/code/common/draw/examples.mdx b/docs/learn/code/common/draw/examples.mdx index a97abdbe..a803d9d9 100644 --- a/docs/learn/code/common/draw/examples.mdx +++ b/docs/learn/code/common/draw/examples.mdx @@ -28,7 +28,7 @@ The primary component for custom drawing is typically found under the path: **Rete Example: Filleted Cube with Custom Drawing Options** @@ -44,7 +44,7 @@ The primary block for custom drawing is typically found under: 5000TRUE111#ff6600#000099#cc33cc20.3TRUETRUETRUE0.01FALSE0.06#ff00ffFALSE0.06#0000ff","version":"0.20.14","type":"blockly"}} + script={{"script":"5000TRUE111#ff6600#000099#cc33cc20.3TRUETRUETRUE0.01FALSE0.06#ff00ffFALSE0.06#0000ff","version":"0.21.0","type":"blockly"}} title="Blockly Drawing Example" description="Draws simple filletted cube geometry." /> @@ -55,7 +55,7 @@ Finally, we achieve the same result using TypeScript. The code follows a similar {\n\n const cubeOptions = new Bit.Inputs.OCCT.CubeDto();\n cubeOptions.size = 5;\n const cube = await bitbybit.occt.shapes.solid.createCube(cubeOptions);\n const filletOptions = new Bit.Inputs.OCCT.FilletDto()\n filletOptions.shape = cube;\n filletOptions.radius = 1;\n const roundedCube = await bitbybit.occt.fillets.filletEdges(filletOptions);\n\n const drawOcctOptions = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n drawOcctOptions.faceColour = \"#0000ff\";\n drawOcctOptions.edgeColour = \"#ff5555\";\n drawOcctOptions.drawVertices = true;\n drawOcctOptions.vertexSize = 0.3;\n // The rest of options remain default (initialized inside the instance)\n const drawnMesh = await bitbybit.draw.drawAnyAsync({ entity: roundedCube, options: drawOcctOptions })\n // drawnMesh is BABYLONJS Mesh if BabylonJS engine is used. In Three.JS it turns into Group.\n return drawnMesh;\n \n}\n\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = async () => {\n\n const cubeOptions = new Bit.Inputs.OCCT.CubeDto();\n cubeOptions.size = 5;\n const cube = await bitbybit.occt.shapes.solid.createCube(cubeOptions);\n const filletOptions = new Bit.Inputs.OCCT.FilletDto()\n filletOptions.shape = cube;\n filletOptions.radius = 1;\n const roundedCube = await bitbybit.occt.fillets.filletEdges(filletOptions);\n\n const drawOcctOptions = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n drawOcctOptions.faceColour = \"#0000ff\";\n drawOcctOptions.edgeColour = \"#ff5555\";\n drawOcctOptions.drawVertices = true;\n drawOcctOptions.vertexSize = 0.3;\n // The rest of options remain default (initialized inside the instance)\n const drawnMesh = await bitbybit.draw.drawAnyAsync({ entity: roundedCube, options: drawOcctOptions })\n // drawnMesh is BABYLONJS Mesh if BabylonJS engine is used. In Three.JS it turns into Group.\n return drawnMesh;\n \n}\n\nstart();","version":"0.21.0","type":"typescript"}} title="TypeScript Drawing Example" description="Draws simple filletted cube geometry." /> \ No newline at end of file diff --git a/docs/learn/code/common/occt/booleans/operations.mdx b/docs/learn/code/common/occt/booleans/operations.mdx index b3911ea0..323788d1 100644 --- a/docs/learn/code/common/occt/booleans/operations.mdx +++ b/docs/learn/code/common/occt/booleans/operations.mdx @@ -49,21 +49,21 @@ The following scripts demonstrate creating three solids (a box, a cylinder, and **TypeScript Example: Union of Solids** {\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 5;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n\n const cylinderOpt = new Bit.Inputs.OCCT.CylinderDto();\n cylinderOpt.radius = 3;\n cylinderOpt.height = 7;\n cylinderOpt.center = [3, 0, 3];\n const cylinder = await bitbybit.occt.shapes.solid.createCylinder(cylinderOpt);\n\n\n const sphereOpt = new Bit.Inputs.OCCT.SphereDto();\n sphereOpt.radius = 3;\n sphereOpt.center = [-1.5, 1.5, -5];\n const sphere = await bitbybit.occt.shapes.solid.createSphere(sphereOpt);\n\n const union = await bitbybit.occt.booleans.union({\n shapes: [box, cylinder, sphere],\n keepEdges: false\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: union\n });\n}\n\nstart();\n","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = async () => {\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 5;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n\n const cylinderOpt = new Bit.Inputs.OCCT.CylinderDto();\n cylinderOpt.radius = 3;\n cylinderOpt.height = 7;\n cylinderOpt.center = [3, 0, 3];\n const cylinder = await bitbybit.occt.shapes.solid.createCylinder(cylinderOpt);\n\n\n const sphereOpt = new Bit.Inputs.OCCT.SphereDto();\n sphereOpt.radius = 3;\n sphereOpt.center = [-1.5, 1.5, -5];\n const sphere = await bitbybit.occt.shapes.solid.createSphere(sphereOpt);\n\n const union = await bitbybit.occt.booleans.union({\n shapes: [box, cylinder, sphere],\n keepEdges: false\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: union\n });\n}\n\nstart();\n","version":"0.21.0","type":"typescript"}} title="Union Three Solids" /> **Blockly Example: Union of Solids** boxspherecylinderbox585000sphere3-1.51.5-5cylinder37303010boxcylindersphereFALSE","version":"0.20.14","type":"blockly"}} + script={{"script":"boxspherecylinderbox585000sphere3-1.51.5-5cylinder37303010boxcylindersphereFALSE","version":"0.21.0","type":"blockly"}} title="Union Three Solids" /> **Rete Example: Union of Solids** @@ -94,21 +94,21 @@ These scripts demonstrate creating a box, cylinder, and sphere, then subtracting **TypeScript Example: Difference of Solids** {\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 5;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n\n const cylinderOpt = new Bit.Inputs.OCCT.CylinderDto();\n cylinderOpt.radius = 3;\n cylinderOpt.height = 7;\n cylinderOpt.center = [3, 0, 3];\n const cylinder = await bitbybit.occt.shapes.solid.createCylinder(cylinderOpt);\n\n\n const sphereOpt = new Bit.Inputs.OCCT.SphereDto();\n sphereOpt.radius = 3;\n sphereOpt.center = [-1.5, 1.5, -5];\n const sphere = await bitbybit.occt.shapes.solid.createSphere(sphereOpt);\n\n const diff = await bitbybit.occt.booleans.difference({\n shape: box,\n shapes: [cylinder, sphere],\n keepEdges: false\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: diff\n });\n}\n\nstart();\n","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = async () => {\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 5;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n\n const cylinderOpt = new Bit.Inputs.OCCT.CylinderDto();\n cylinderOpt.radius = 3;\n cylinderOpt.height = 7;\n cylinderOpt.center = [3, 0, 3];\n const cylinder = await bitbybit.occt.shapes.solid.createCylinder(cylinderOpt);\n\n\n const sphereOpt = new Bit.Inputs.OCCT.SphereDto();\n sphereOpt.radius = 3;\n sphereOpt.center = [-1.5, 1.5, -5];\n const sphere = await bitbybit.occt.shapes.solid.createSphere(sphereOpt);\n\n const diff = await bitbybit.occt.booleans.difference({\n shape: box,\n shapes: [cylinder, sphere],\n keepEdges: false\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: diff\n });\n}\n\nstart();\n","version":"0.21.0","type":"typescript"}} title="Difference of Solids" /> **Blockly Example: Difference of Solids** boxspherecylinderbox585000sphere3-1.51.5-5cylinder37303010boxcylindersphereFALSE","version":"0.20.14","type":"blockly"}} + script={{"script":"boxspherecylinderbox585000sphere3-1.51.5-5cylinder37303010boxcylindersphereFALSE","version":"0.21.0","type":"blockly"}} title="Difference of Solids" /> **Rete Example: Difference of Solids** @@ -138,21 +138,21 @@ These scripts create a box, cylinder, and sphere, and then compute their common **TypeScript Example: Intersection of Solids** {\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 5;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n\n const cylinderOpt = new Bit.Inputs.OCCT.CylinderDto();\n cylinderOpt.radius = 3;\n cylinderOpt.height = 7;\n cylinderOpt.center = [3, 0, 3];\n const cylinder = await bitbybit.occt.shapes.solid.createCylinder(cylinderOpt);\n\n\n const sphereOpt = new Bit.Inputs.OCCT.SphereDto();\n sphereOpt.radius = 3;\n sphereOpt.center = [-1.5, 1.5, -5];\n const sphere = await bitbybit.occt.shapes.solid.createSphere(sphereOpt);\n\n const diff = await bitbybit.occt.booleans.intersection({\n shapes: [box, cylinder, sphere],\n keepEdges: false\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: diff\n });\n}\n\nstart();\n","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = async () => {\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 5;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n\n const cylinderOpt = new Bit.Inputs.OCCT.CylinderDto();\n cylinderOpt.radius = 3;\n cylinderOpt.height = 7;\n cylinderOpt.center = [3, 0, 3];\n const cylinder = await bitbybit.occt.shapes.solid.createCylinder(cylinderOpt);\n\n\n const sphereOpt = new Bit.Inputs.OCCT.SphereDto();\n sphereOpt.radius = 3;\n sphereOpt.center = [-1.5, 1.5, -5];\n const sphere = await bitbybit.occt.shapes.solid.createSphere(sphereOpt);\n\n const diff = await bitbybit.occt.booleans.intersection({\n shapes: [box, cylinder, sphere],\n keepEdges: false\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: diff\n });\n}\n\nstart();\n","version":"0.21.0","type":"typescript"}} title="Intersection of Solids" /> **Blockly Example: Intersection of Solids** boxspherecylinderbox585000sphere3-1.51.5-5cylinder37303010boxcylindersphereFALSE","version":"0.20.14","type":"blockly"}} + script={{"script":"boxspherecylinderbox585000sphere3-1.51.5-5cylinder37303010boxcylindersphereFALSE","version":"0.21.0","type":"blockly"}} title="Intersection of Solids" /> **Rete Example: Intersection of Solids** diff --git a/docs/learn/code/common/occt/dimensions/angular-dimension.md b/docs/learn/code/common/occt/dimensions/angular-dimension.md index d079b26a..7e96fcb2 100644 --- a/docs/learn/code/common/occt/dimensions/angular-dimension.md +++ b/docs/learn/code/common/occt/dimensions/angular-dimension.md @@ -32,21 +32,21 @@ Angular dimensions measure the angle between two direction vectors and display t direction1direction2centerdirection1100direction2011center000direction1direction2center20.30.11deg0.30.4FALSE","version":"0.20.14","type":"blockly"}} + script={{"script":"direction1direction2centerdirection1100direction2011center000direction1direction2center20.30.11deg0.30.4FALSE","version":"0.21.0","type":"blockly"}} title="Simple angular dimension between two directions" /> {\n // Define two direction vectors to measure angle between\n const direction1: Vector3 = [1, 0, 0]; // X-axis direction\n const direction2: Vector3 = [0, 1, 1]; // Direction at 45deg from Y and Z\n const center: Point3 = [0, 0, 0]; // Origin point\n\n // Create an angular dimension between the directions\n const dimensionOptions = new SimpleAngularDimensionDto();\n dimensionOptions.direction1 = direction1;\n dimensionOptions.direction2 = direction2;\n dimensionOptions.center = center;\n dimensionOptions.radius = 2;\n dimensionOptions.offsetFromCenter = 0.3;\n dimensionOptions.extraSize = 0.1;\n dimensionOptions.decimalPlaces = 1;\n dimensionOptions.labelSuffix = \"deg\";\n dimensionOptions.labelSize = 0.3;\n dimensionOptions.labelOffset = 0.4;\n dimensionOptions.radians = false;\n\n // Create and draw the dimension\n const dimension = await bitbybit.occt.dimensions.simpleAngularDimension(dimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: dimension });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import the required DTO for angular dimensions\nconst { SimpleAngularDimensionDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Define the main function\nconst start = async () => {\n // Define two direction vectors to measure angle between\n const direction1: Vector3 = [1, 0, 0]; // X-axis direction\n const direction2: Vector3 = [0, 1, 1]; // Direction at 45deg from Y and Z\n const center: Point3 = [0, 0, 0]; // Origin point\n\n // Create an angular dimension between the directions\n const dimensionOptions = new SimpleAngularDimensionDto();\n dimensionOptions.direction1 = direction1;\n dimensionOptions.direction2 = direction2;\n dimensionOptions.center = center;\n dimensionOptions.radius = 2;\n dimensionOptions.offsetFromCenter = 0.3;\n dimensionOptions.extraSize = 0.1;\n dimensionOptions.decimalPlaces = 1;\n dimensionOptions.labelSuffix = \"deg\";\n dimensionOptions.labelSize = 0.3;\n dimensionOptions.labelOffset = 0.4;\n dimensionOptions.radians = false;\n\n // Create and draw the dimension\n const dimension = await bitbybit.occt.dimensions.simpleAngularDimension(dimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: dimension });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Simple angular dimension between two directions" /> @@ -62,21 +62,21 @@ Angular dimensions are particularly useful for complex 3D geometry like cones, w conerotatedConeconeEdgetranslatedEdgestartPointendPointdirection1cone52.75360000010rotatedConecone010-90coneEdgerotatedCone2translatedEdgeconeEdge-100startPointtranslatedEdgeendPointtranslatedEdgedirection1endPointstartPointrotatedConedirection1-100startPoint7202(deg)0.40.6FALSE","version":"0.20.14","type":"blockly"}} + script={{"script":"conerotatedConeconeEdgetranslatedEdgestartPointendPointdirection1cone52.75360000010rotatedConecone010-90coneEdgerotatedCone2translatedEdgeconeEdge-100startPointtranslatedEdgeendPointtranslatedEdgedirection1endPointstartPointrotatedConedirection1-100startPoint7202(deg)0.40.6FALSE","version":"0.21.0","type":"blockly"}} title="Cone with apex angle measurement" /> {\n // Create a cone with specific dimensions\n const coneOptions = new ConeDto();\n coneOptions.radius1 = 5;\n coneOptions.radius2 = 2.7; // Variable radius for apex angle\n coneOptions.height = 5;\n coneOptions.angle = 360;\n coneOptions.center = [0, 0, 0];\n coneOptions.direction = [0, 1, 0];\n const cone = await solid.createCone(coneOptions);\n\n // Rotate the cone -90 degrees around Y axis for better visualization\n const rotatedCone = await transforms.rotate({\n shape: cone,\n axis: [0, 1, 0],\n angle: -90\n });\n\n // Draw the rotated cone\n bitbybit.draw.drawAnyAsync({ entity: rotatedCone });\n\n // Get edge 2 from the cone (this is a generatrix line)\n const coneEdge = await edge.getEdge({ shape: rotatedCone, index: 2 });\n\n // Translate the edge to position it for measurement\n const translatedEdge = await transforms.translate({\n shape: coneEdge,\n translation: [-1, 0, 0]\n });\n\n // Get start and end points from the translated edge\n const startPoint = await edge.startPointOnEdge({ shape: translatedEdge });\n const endPoint = await edge.endPointOnEdge({ shape: translatedEdge });\n\n // Calculate direction vector from start to end point\n const direction1 = bitbybit.vector.sub({ first: endPoint, second: startPoint }) as Vector3;\n\n // Create angular dimension to measure apex angle\n const dimensionOptions = new SimpleAngularDimensionDto();\n dimensionOptions.direction1 = direction1;\n dimensionOptions.direction2 = [-1, 0, 0]; // Reference direction\n dimensionOptions.center = startPoint; // Apex point\n dimensionOptions.radius = 7;\n dimensionOptions.offsetFromCenter = 2;\n dimensionOptions.extraSize = 0;\n dimensionOptions.decimalPlaces = 2;\n dimensionOptions.labelSuffix = \"(deg)\";\n dimensionOptions.labelSize = 0.4;\n dimensionOptions.labelOffset = 0.6;\n dimensionOptions.radians = false;\n\n // Create and draw the angular dimension\n const dimension = await dimensions.simpleAngularDimension(dimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: dimension });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs for creating shapes and dimensions\nconst { ConeDto, SimpleAngularDimensionDto } = Bit.Inputs.OCCT;\n// Import types for type safety\ntype TopoDSSolidPointer = Bit.Inputs.OCCT.TopoDSSolidPointer;\ntype TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Get access to OCCT modules\nconst { shapes, dimensions, transforms } = bitbybit.occt;\nconst { solid, edge } = shapes;\n\n// Define the main function to create a cone with angular dimension\nconst start = async () => {\n // Create a cone with specific dimensions\n const coneOptions = new ConeDto();\n coneOptions.radius1 = 5;\n coneOptions.radius2 = 2.7; // Variable radius for apex angle\n coneOptions.height = 5;\n coneOptions.angle = 360;\n coneOptions.center = [0, 0, 0];\n coneOptions.direction = [0, 1, 0];\n const cone = await solid.createCone(coneOptions);\n\n // Rotate the cone -90 degrees around Y axis for better visualization\n const rotatedCone = await transforms.rotate({\n shape: cone,\n axis: [0, 1, 0],\n angle: -90\n });\n\n // Draw the rotated cone\n bitbybit.draw.drawAnyAsync({ entity: rotatedCone });\n\n // Get edge 2 from the cone (this is a generatrix line)\n const coneEdge = await edge.getEdge({ shape: rotatedCone, index: 2 });\n\n // Translate the edge to position it for measurement\n const translatedEdge = await transforms.translate({\n shape: coneEdge,\n translation: [-1, 0, 0]\n });\n\n // Get start and end points from the translated edge\n const startPoint = await edge.startPointOnEdge({ shape: translatedEdge });\n const endPoint = await edge.endPointOnEdge({ shape: translatedEdge });\n\n // Calculate direction vector from start to end point\n const direction1 = bitbybit.vector.sub({ first: endPoint, second: startPoint }) as Vector3;\n\n // Create angular dimension to measure apex angle\n const dimensionOptions = new SimpleAngularDimensionDto();\n dimensionOptions.direction1 = direction1;\n dimensionOptions.direction2 = [-1, 0, 0]; // Reference direction\n dimensionOptions.center = startPoint; // Apex point\n dimensionOptions.radius = 7;\n dimensionOptions.offsetFromCenter = 2;\n dimensionOptions.extraSize = 0;\n dimensionOptions.decimalPlaces = 2;\n dimensionOptions.labelSuffix = \"(deg)\";\n dimensionOptions.labelSize = 0.4;\n dimensionOptions.labelOffset = 0.6;\n dimensionOptions.radians = false;\n\n // Create and draw the angular dimension\n const dimension = await dimensions.simpleAngularDimension(dimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: dimension });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Cone with apex angle measurement" /> diff --git a/docs/learn/code/common/occt/dimensions/linear-dimension.md b/docs/learn/code/common/occt/dimensions/linear-dimension.md index 01c2fa62..9f432405 100644 --- a/docs/learn/code/common/occt/dimensions/linear-dimension.md +++ b/docs/learn/code/common/occt/dimensions/linear-dimension.md @@ -26,21 +26,21 @@ Linear dimensions measure straight-line distances between two points and display point1point2point1-500point2500point1point2point1point20100.30.21cm0.40.80","version":"0.20.14","type":"blockly"}} + script={{"script":"point1point2point1-500point2500point1point2point1point20100.30.21cm0.40.80","version":"0.21.0","type":"blockly"}} title="Simple linear dimension between two points" /> {\n // Define two points to measure between\n const startPoint: Point3 = [-5, 0, 0];\n const endPoint: Point3 = [5, 0, 0];\n\n // Draw the points for reference\n bitbybit.draw.drawAnyAsync({ entity: startPoint });\n bitbybit.draw.drawAnyAsync({ entity: endPoint });\n\n // Create a linear dimension between the points\n const dimensionOptions = new SimpleLinearLengthDimensionDto();\n dimensionOptions.start = startPoint;\n dimensionOptions.end = endPoint;\n dimensionOptions.direction = [0, 1, 0]; // Offset in Y direction\n dimensionOptions.offsetFromPoints = 0.3;\n dimensionOptions.crossingSize = 0.2;\n dimensionOptions.decimalPlaces = 1;\n dimensionOptions.labelSuffix = \"cm\";\n dimensionOptions.labelSize = 0.4;\n dimensionOptions.labelOffset = 0.8;\n dimensionOptions.labelRotation = 0;\n\n // Create and draw the dimension\n const dimension = await bitbybit.occt.dimensions.simpleLinearLengthDimension(dimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: dimension });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import the required DTO for linear dimensions\nconst { SimpleLinearLengthDimensionDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\n\n// Define the main function\nconst start = async () => {\n // Define two points to measure between\n const startPoint: Point3 = [-5, 0, 0];\n const endPoint: Point3 = [5, 0, 0];\n\n // Draw the points for reference\n bitbybit.draw.drawAnyAsync({ entity: startPoint });\n bitbybit.draw.drawAnyAsync({ entity: endPoint });\n\n // Create a linear dimension between the points\n const dimensionOptions = new SimpleLinearLengthDimensionDto();\n dimensionOptions.start = startPoint;\n dimensionOptions.end = endPoint;\n dimensionOptions.direction = [0, 1, 0]; // Offset in Y direction\n dimensionOptions.offsetFromPoints = 0.3;\n dimensionOptions.crossingSize = 0.2;\n dimensionOptions.decimalPlaces = 1;\n dimensionOptions.labelSuffix = \"cm\";\n dimensionOptions.labelSize = 0.4;\n dimensionOptions.labelOffset = 0.8;\n dimensionOptions.labelRotation = 0;\n\n // Create and draw the dimension\n const dimension = await bitbybit.occt.dimensions.simpleLinearLengthDimension(dimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: dimension });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Simple linear dimension between two points" /> @@ -51,21 +51,21 @@ Linear dimensions update automatically when geometry changes, keeping your docum widthlengthheightboxfirstEdgesecondEdgethirdEdgewidth13.2length9.1height5.3boxwidthlengthheight000TRUEfirstEdgebox1secondEdgebox8thirdEdgebox11firstEdgefirstEdge-2000.20.22(cm)0.51180secondEdgesecondEdge2000.20.22(cm)0.51180thirdEdgethirdEdge00-20.20.22(cm)0.51180box","version":"0.20.14","type":"blockly"}} + script={{"script":"widthlengthheightboxfirstEdgesecondEdgethirdEdgewidth13.2length9.1height5.3boxwidthlengthheight000TRUEfirstEdgebox1secondEdgebox8thirdEdgebox11firstEdgefirstEdge-2000.20.22(cm)0.51180secondEdgesecondEdge2000.20.22(cm)0.51180thirdEdgethirdEdge00-20.20.22(cm)0.51180box","version":"0.21.0","type":"blockly"}} title="Linear dimensions applied on box" /> {\n // Create a box with specific dimensions\n const boxOptions = new BoxDto();\n boxOptions.width = 13.2;\n boxOptions.length = 9.1;\n boxOptions.height = 5.3;\n boxOptions.center = [0, 0, 0];\n boxOptions.originOnCenter = true;\n const box = await solid.createBox(boxOptions);\n\n // Draw the box first\n bitbybit.draw.drawAnyAsync({ entity: box });\n\n // Get all edges from the box for dimension measurements\n const edges = await edge.getEdges({ shape: box });\n\n // Create width dimension (measuring edge 0)\n const widthEdge = edges[0];\n const widthStartPoint = await edge.startPointOnEdge({ shape: widthEdge });\n const widthEndPoint = await edge.endPointOnEdge({ shape: widthEdge });\n\n const widthDimensionOptions = new SimpleLinearLengthDimensionDto();\n widthDimensionOptions.start = widthStartPoint;\n widthDimensionOptions.end = widthEndPoint;\n widthDimensionOptions.direction = [-2, 0, 0]; // Offset to the left\n widthDimensionOptions.offsetFromPoints = 0.2;\n widthDimensionOptions.crossingSize = 0.2;\n widthDimensionOptions.decimalPlaces = 2;\n widthDimensionOptions.labelSuffix = \"(cm)\";\n widthDimensionOptions.labelSize = 0.5;\n widthDimensionOptions.labelOffset = 1;\n widthDimensionOptions.labelRotation = 180;\n \n const widthDimension = await dimensions.simpleLinearLengthDimension(widthDimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: widthDimension });\n\n // Create height dimension (measuring edge 10)\n const heightEdge = edges[10];\n const heightStartPoint = await edge.startPointOnEdge({ shape: heightEdge });\n const heightEndPoint = await edge.endPointOnEdge({ shape: heightEdge });\n\n const heightDimensionOptions = new SimpleLinearLengthDimensionDto();\n heightDimensionOptions.start = heightStartPoint;\n heightDimensionOptions.end = heightEndPoint;\n heightDimensionOptions.direction = [0, 0, -2]; // Offset toward the back\n heightDimensionOptions.offsetFromPoints = 0.2;\n heightDimensionOptions.crossingSize = 0.2;\n heightDimensionOptions.decimalPlaces = 2;\n heightDimensionOptions.labelSuffix = \"(cm)\";\n heightDimensionOptions.labelSize = 0.5;\n heightDimensionOptions.labelOffset = 1;\n heightDimensionOptions.labelRotation = 180;\n \n const heightDimension = await dimensions.simpleLinearLengthDimension(heightDimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: heightDimension });\n\n // Create depth dimension (measuring edge 7)\n const depthEdge = edges[7];\n const depthStartPoint = await edge.endPointOnEdge({ shape: depthEdge });\n const depthEndPoint = await edge.startPointOnEdge({ shape: depthEdge });\n\n const depthDimensionOptions = new SimpleLinearLengthDimensionDto();\n depthDimensionOptions.start = depthStartPoint;\n depthDimensionOptions.end = depthEndPoint;\n depthDimensionOptions.direction = [2, 0, 0]; // Offset to the right\n depthDimensionOptions.offsetFromPoints = 0.2;\n depthDimensionOptions.crossingSize = 0.2;\n depthDimensionOptions.decimalPlaces = 2;\n depthDimensionOptions.labelSuffix = \"(cm)\";\n depthDimensionOptions.labelSize = 0.5;\n depthDimensionOptions.labelOffset = 1;\n depthDimensionOptions.labelRotation = 180;\n \n const depthDimension = await dimensions.simpleLinearLengthDimension(depthDimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: depthDimension });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs for creating shapes and dimensions\nconst { BoxDto, SimpleLinearLengthDimensionDto } = Bit.Inputs.OCCT;\n// Import types for type safety\ntype TopoDSSolidPointer = Bit.Inputs.OCCT.TopoDSSolidPointer;\ntype TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;\n\n// Get access to OCCT modules\nconst { shapes, dimensions } = bitbybit.occt;\nconst { solid, edge } = shapes;\n\n// Define the main function to create a box with linear dimensions\nconst start = async () => {\n // Create a box with specific dimensions\n const boxOptions = new BoxDto();\n boxOptions.width = 13.2;\n boxOptions.length = 9.1;\n boxOptions.height = 5.3;\n boxOptions.center = [0, 0, 0];\n boxOptions.originOnCenter = true;\n const box = await solid.createBox(boxOptions);\n\n // Draw the box first\n bitbybit.draw.drawAnyAsync({ entity: box });\n\n // Get all edges from the box for dimension measurements\n const edges = await edge.getEdges({ shape: box });\n\n // Create width dimension (measuring edge 0)\n const widthEdge = edges[0];\n const widthStartPoint = await edge.startPointOnEdge({ shape: widthEdge });\n const widthEndPoint = await edge.endPointOnEdge({ shape: widthEdge });\n\n const widthDimensionOptions = new SimpleLinearLengthDimensionDto();\n widthDimensionOptions.start = widthStartPoint;\n widthDimensionOptions.end = widthEndPoint;\n widthDimensionOptions.direction = [-2, 0, 0]; // Offset to the left\n widthDimensionOptions.offsetFromPoints = 0.2;\n widthDimensionOptions.crossingSize = 0.2;\n widthDimensionOptions.decimalPlaces = 2;\n widthDimensionOptions.labelSuffix = \"(cm)\";\n widthDimensionOptions.labelSize = 0.5;\n widthDimensionOptions.labelOffset = 1;\n widthDimensionOptions.labelRotation = 180;\n \n const widthDimension = await dimensions.simpleLinearLengthDimension(widthDimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: widthDimension });\n\n // Create height dimension (measuring edge 10)\n const heightEdge = edges[10];\n const heightStartPoint = await edge.startPointOnEdge({ shape: heightEdge });\n const heightEndPoint = await edge.endPointOnEdge({ shape: heightEdge });\n\n const heightDimensionOptions = new SimpleLinearLengthDimensionDto();\n heightDimensionOptions.start = heightStartPoint;\n heightDimensionOptions.end = heightEndPoint;\n heightDimensionOptions.direction = [0, 0, -2]; // Offset toward the back\n heightDimensionOptions.offsetFromPoints = 0.2;\n heightDimensionOptions.crossingSize = 0.2;\n heightDimensionOptions.decimalPlaces = 2;\n heightDimensionOptions.labelSuffix = \"(cm)\";\n heightDimensionOptions.labelSize = 0.5;\n heightDimensionOptions.labelOffset = 1;\n heightDimensionOptions.labelRotation = 180;\n \n const heightDimension = await dimensions.simpleLinearLengthDimension(heightDimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: heightDimension });\n\n // Create depth dimension (measuring edge 7)\n const depthEdge = edges[7];\n const depthStartPoint = await edge.endPointOnEdge({ shape: depthEdge });\n const depthEndPoint = await edge.startPointOnEdge({ shape: depthEdge });\n\n const depthDimensionOptions = new SimpleLinearLengthDimensionDto();\n depthDimensionOptions.start = depthStartPoint;\n depthDimensionOptions.end = depthEndPoint;\n depthDimensionOptions.direction = [2, 0, 0]; // Offset to the right\n depthDimensionOptions.offsetFromPoints = 0.2;\n depthDimensionOptions.crossingSize = 0.2;\n depthDimensionOptions.decimalPlaces = 2;\n depthDimensionOptions.labelSuffix = \"(cm)\";\n depthDimensionOptions.labelSize = 0.5;\n depthDimensionOptions.labelOffset = 1;\n depthDimensionOptions.labelRotation = 180;\n \n const depthDimension = await dimensions.simpleLinearLengthDimension(depthDimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: depthDimension });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Linear dimensions applied on box" /> diff --git a/docs/learn/code/common/occt/dimensions/pin-with-label.md b/docs/learn/code/common/occt/dimensions/pin-with-label.md index 6f2695b0..1408556f 100644 --- a/docs/learn/code/common/occt/dimensions/pin-with-label.md +++ b/docs/learn/code/common/occt/dimensions/pin-with-label.md @@ -39,21 +39,21 @@ The most basic use case is creating a pin with static text to mark important poi 0003211000Important Point0.30.4","version":"0.20.14","type":"blockly"}} + script={{"script":"0003211000Important Point0.30.4","version":"0.21.0","type":"blockly"}} title="Simple pin with static label" /> {\n // Define points for the pin\n const startPoint: Point3 = [0, 0, 0];\n const endPoint: Point3 = [3, 2, 1];\n const direction: Vector3 = [1, 0, 0];\n\n // Create pin with label options\n const pinOptions = new PinWithLabelDto();\n pinOptions.startPoint = startPoint;\n pinOptions.endPoint = endPoint;\n pinOptions.direction = direction;\n pinOptions.offsetFromStart = 0;\n pinOptions.label = \"Important Point\";\n pinOptions.labelOffset = 0.3;\n pinOptions.labelSize = 0.4;\n\n // Create and draw the pin\n const pin = await bitbybit.occt.dimensions.pinWithLabel(pinOptions);\n bitbybit.draw.drawAnyAsync({ entity: pin });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import the required DTO for pin with label\nconst { PinWithLabelDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Define the main function\nconst start = async () => {\n // Define points for the pin\n const startPoint: Point3 = [0, 0, 0];\n const endPoint: Point3 = [3, 2, 1];\n const direction: Vector3 = [1, 0, 0];\n\n // Create pin with label options\n const pinOptions = new PinWithLabelDto();\n pinOptions.startPoint = startPoint;\n pinOptions.endPoint = endPoint;\n pinOptions.direction = direction;\n pinOptions.offsetFromStart = 0;\n pinOptions.label = \"Important Point\";\n pinOptions.labelOffset = 0.3;\n pinOptions.labelSize = 0.4;\n\n // Create and draw the pin\n const pin = await bitbybit.occt.dimensions.pinWithLabel(pinOptions);\n bitbybit.draw.drawAnyAsync({ entity: pin });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Simple pin with static label" /> @@ -74,21 +74,21 @@ A more practical application combines pin labels with calculated geometric prope radiusspherevolumeradius2.5sphereradius000volumesphere00radius43ADDradius21000Vol: {0} m3volume20.30.4sphere","version":"0.20.14","type":"blockly"}} + script={{"script":"radiusspherevolumeradius2.5sphereradius000volumesphere00radius43ADDradius21000Vol: {0} m3volume20.30.4sphere","version":"0.21.0","type":"blockly"}} title="Sphere with volume pin label" /> {\n // Parametric radius value\n const radius = 2.5;\n\n // Create a sphere\n const sphereOptions = new SphereDto();\n sphereOptions.radius = radius;\n sphereOptions.center = [0, 0, 0] as Point3;\n\n const sphere = await solid.createSphere(sphereOptions);\n\n // Calculate sphere volume\n const volume = await solid.getSolidVolume({ shape: sphere });\n const roundedVolume = math.roundToDecimals({ number: volume, decimalPlaces: 2 });\n\n // Format volume as text with units\n const volumeText = text.format({\n text: \"Vol: {0} m3\",\n values: [text.toString({ item: roundedVolume })]\n });\n\n // Create pin with calculated volume label\n const pinOptions = new PinWithLabelDto();\n pinOptions.startPoint = [0, 0, radius] as Point3; // Start at top of sphere\n pinOptions.endPoint = [4, 3, radius + 2] as Point3; // Position for visibility\n pinOptions.direction = [1, 0, 0] as Vector3;\n pinOptions.offsetFromStart = 0;\n pinOptions.label = volumeText;\n pinOptions.labelOffset = 0.3;\n pinOptions.labelSize = 0.4;\n\n // Create and draw the pin\n const pin = await dimensions.pinWithLabel(pinOptions);\n \n // Draw both sphere and pin\n bitbybit.draw.drawAnyAsync({ entity: sphere });\n bitbybit.draw.drawAnyAsync({ entity: pin });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs and types\nconst { SphereDto, PinWithLabelDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Get access to OCCT modules\nconst { solid } = bitbybit.occt.shapes;\nconst { dimensions } = bitbybit.occt;\nconst { math, text } = bitbybit;\n\n// Define the main function\nconst start = async () => {\n // Parametric radius value\n const radius = 2.5;\n\n // Create a sphere\n const sphereOptions = new SphereDto();\n sphereOptions.radius = radius;\n sphereOptions.center = [0, 0, 0] as Point3;\n\n const sphere = await solid.createSphere(sphereOptions);\n\n // Calculate sphere volume\n const volume = await solid.getSolidVolume({ shape: sphere });\n const roundedVolume = math.roundToDecimals({ number: volume, decimalPlaces: 2 });\n\n // Format volume as text with units\n const volumeText = text.format({\n text: \"Vol: {0} m3\",\n values: [text.toString({ item: roundedVolume })]\n });\n\n // Create pin with calculated volume label\n const pinOptions = new PinWithLabelDto();\n pinOptions.startPoint = [0, 0, radius] as Point3; // Start at top of sphere\n pinOptions.endPoint = [4, 3, radius + 2] as Point3; // Position for visibility\n pinOptions.direction = [1, 0, 0] as Vector3;\n pinOptions.offsetFromStart = 0;\n pinOptions.label = volumeText;\n pinOptions.labelOffset = 0.3;\n pinOptions.labelSize = 0.4;\n\n // Create and draw the pin\n const pin = await dimensions.pinWithLabel(pinOptions);\n \n // Draw both sphere and pin\n bitbybit.draw.drawAnyAsync({ entity: sphere });\n bitbybit.draw.drawAnyAsync({ entity: pin });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Sphere with volume pin label" /> diff --git a/docs/learn/code/common/occt/fillets/chamfer-circular-edges.mdx b/docs/learn/code/common/occt/fillets/chamfer-circular-edges.mdx index 32935ed8..6182ce33 100644 --- a/docs/learn/code/common/occt/fillets/chamfer-circular-edges.mdx +++ b/docs/learn/code/common/occt/fillets/chamfer-circular-edges.mdx @@ -25,21 +25,21 @@ The examples below demonstrate creating a box with a cylindrical hole through it **TypeScript Example: Chamfer Circular Edge of a Hole** {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n const cylinderOpt = new Bit.Inputs.OCCT.CylinderDto();\n cylinderOpt.direction = [1, 0, 0];\n cylinderOpt.center = [-5, 0, 0];\n cylinderOpt.radius = 2;\n cylinderOpt.height = 10;\n\n const cylinder = await bitbybit.occt.shapes.solid.createCylinder(cylinderOpt)\n\n const difference = await bitbybit.occt.booleans.difference({\n shape: box,\n shapes: [cylinder],\n keepEdges: false\n });\n\n const chamfered = await bitbybit.occt.fillets.chamferEdges({\n shape: difference,\n distance: 0.4\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: chamfered,\n });\n}\n\nstart();\n","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = async () => {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n const cylinderOpt = new Bit.Inputs.OCCT.CylinderDto();\n cylinderOpt.direction = [1, 0, 0];\n cylinderOpt.center = [-5, 0, 0];\n cylinderOpt.radius = 2;\n cylinderOpt.height = 10;\n\n const cylinder = await bitbybit.occt.shapes.solid.createCylinder(cylinderOpt)\n\n const difference = await bitbybit.occt.booleans.difference({\n shape: box,\n shapes: [cylinder],\n keepEdges: false\n });\n\n const chamfered = await bitbybit.occt.fillets.chamferEdges({\n shape: difference,\n distance: 0.4\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: chamfered,\n });\n}\n\nstart();\n","version":"0.21.0","type":"typescript"}} title="Chamfer Circular Edge" /> **Blockly Example: Chamfer Circular Edge of a Hole** differenceSoliddifferenceSolid5810000210-500100FALSEdifferenceSolid0.4","version":"0.20.14","type":"blockly"}} + script={{"script":"differenceSoliddifferenceSolid5810000210-500100FALSEdifferenceSolid0.4","version":"0.21.0","type":"blockly"}} title="Chamfer Circular Edge" /> **Rete Example: Chamfer Circular Edge of a Hole** diff --git a/docs/learn/code/common/occt/fillets/chamfers-intro.mdx b/docs/learn/code/common/occt/fillets/chamfers-intro.mdx index 55a1a022..65ad5241 100644 --- a/docs/learn/code/common/occt/fillets/chamfers-intro.mdx +++ b/docs/learn/code/common/occt/fillets/chamfers-intro.mdx @@ -48,21 +48,21 @@ The following examples in TypeScript, Rete, and Blockly demonstrate creating a s **TypeScript Example: Chamfer All Edges of a Solid** {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n const chamfered = await bitbybit.occt.fillets.chamferEdges({\n shape: box,\n distance: 1,\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: chamfered,\n });\n}\n\nstart();\n","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = async () => {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n const chamfered = await bitbybit.occt.fillets.chamferEdges({\n shape: box,\n distance: 1,\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: chamfered,\n });\n}\n\nstart();\n","version":"0.21.0","type":"typescript"}} title="Chamfer All Edges of Solid" /> **Blockly Example: Chamfer All Edges of a Solid** 58100001","version":"0.20.14","type":"blockly"}} + script={{"script":"58100001","version":"0.21.0","type":"blockly"}} title="Chamfer All Edges of Solid" /> **Rete Example: Chamfer All Edges of a Solid** diff --git a/docs/learn/code/common/occt/fillets/chamfers-var-radius-on-spec-edges.mdx b/docs/learn/code/common/occt/fillets/chamfers-var-radius-on-spec-edges.mdx index 3e331e79..cfd1a191 100644 --- a/docs/learn/code/common/occt/fillets/chamfers-var-radius-on-spec-edges.mdx +++ b/docs/learn/code/common/occt/fillets/chamfers-var-radius-on-spec-edges.mdx @@ -28,21 +28,21 @@ The examples below demonstrate creating a solid box and then applying chamfers w **TypeScript Example: Chamfer Specific Edges with Variable Distances** {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n const chamfered = await bitbybit.occt.fillets.chamferEdges({\n shape: box,\n distanceList: [0.2, 1.2, 2],\n indexes: [1, 2, 3]\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: chamfered,\n });\n}\n\nstart();\n","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = async () => {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n const chamfered = await bitbybit.occt.fillets.chamferEdges({\n shape: box,\n distanceList: [0.2, 1.2, 2],\n indexes: [1, 2, 3]\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: chamfered,\n });\n}\n\nstart();\n","version":"0.21.0","type":"typescript"}} title="Chamfer Specific Edges of Solid" /> **Blockly Example: Chamfer Specific Edges with Variable Distances** 58100000.10.31.22123","version":"0.20.14","type":"blockly"}} + script={{"script":"58100000.10.31.22123","version":"0.21.0","type":"blockly"}} title="Chamfer Specific Edges of Solid" /> **Rete Example: Chamfer Specific Edges with Variable Distances** diff --git a/docs/learn/code/common/occt/fillets/fillet-3d-wires.mdx b/docs/learn/code/common/occt/fillets/fillet-3d-wires.mdx index a222151c..63c8ba93 100644 --- a/docs/learn/code/common/occt/fillets/fillet-3d-wires.mdx +++ b/docs/learn/code/common/occt/fillets/fillet-3d-wires.mdx @@ -55,21 +55,21 @@ In these examples, we first construct a 3D star-shaped wire. Then, we apply diff **TypeScript Example: Fillet Specific Corners of a 3D Wire** {\n\n const repeatOpt = new Bit.Inputs.Lists.MultiplyItemDto([innerFillet, outerFillet], nrRays);\n const radiusList = bitbybit.lists.repeat(repeatOpt).flat();\n const spanOptions = new Bit.Inputs.Vector.SpanDto(1, 1, nrRays * 2);\n const indexes = bitbybit.vector.span(spanOptions);\n\n const starOptions = new Bit.Inputs.OCCT.StarDto(outerStarRadius, innerStarRadius, nrRays, [0, 0, 0], [0, 1, 0], 4, false);\n const star = await bitbybit.occt.shapes.wire.createStarWire(starOptions);\n\n const filletOptions = new Bit.Inputs.OCCT.Fillet3DWireDto(star, undefined, [0, 1, 0], radiusList, indexes);\n const starFillet = await bitbybit.occt.fillets.fillet3DWire(filletOptions);\n\n const startFilletTranslated1 = await bitbybit.occt.transforms.translate({ shape: starFillet, translation: [0, 5, 0] })\n const startFilletTranslated2 = await bitbybit.occt.transforms.translate({ shape: starFillet, translation: [0, 10, 0] })\n\n\n const starFace = await bitbybit.occt.shapes.face.createFaceFromWire({ shape: startFilletTranslated2, planar: false });\n const starThick = await bitbybit.occt.operations.makeThickSolidSimple({ shape: starFace, offset: -1 });\n const starThickFillet = await bitbybit.occt.fillets.filletEdges({ shape: starThick, radius: 0.3 });\n\n const drawOptions = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n drawOptions.edgeWidth = 15;\n bitbybit.draw.drawAnyAsync({ entity: star, options: drawOptions });\n bitbybit.draw.drawAnyAsync({ entity: startFilletTranslated1, options: drawOptions });\n drawOptions.faceColour = \"#5555ff\";\n drawOptions.edgeColour = \"#000000\";\n drawOptions.edgeWidth = 2;\n drawOptions.precision = 0.005;\n bitbybit.draw.drawAnyAsync({ entity: starThickFillet, options: drawOptions });\n\n const gridOptions = new Bit.Inputs.Draw.SceneDrawGridMeshDto();\n bitbybit.draw.drawGridMesh(gridOptions);\n const skyboxOptions = new Bit.Inputs.BabylonScene.SkyboxDto();\n skyboxOptions.skybox = Bit.Inputs.Base.skyboxEnum.clearSky;\n bitbybit.babylon.scene.enableSkybox(skyboxOptions);\n}\n\nstart();\n","version":"0.20.14","type":"typescript"}} + script={{"script":"const nrRays = 7;\nconst outerStarRadius = 10;\nconst innerStarRadius = 4;\nconst outerFillet = 0.6;\nconst innerFillet = 1.7;\n\nconst start = async () => {\n\n const repeatOpt = new Bit.Inputs.Lists.MultiplyItemDto([innerFillet, outerFillet], nrRays);\n const radiusList = bitbybit.lists.repeat(repeatOpt).flat();\n const spanOptions = new Bit.Inputs.Vector.SpanDto(1, 1, nrRays * 2);\n const indexes = bitbybit.vector.span(spanOptions);\n\n const starOptions = new Bit.Inputs.OCCT.StarDto(outerStarRadius, innerStarRadius, nrRays, [0, 0, 0], [0, 1, 0], 4, false);\n const star = await bitbybit.occt.shapes.wire.createStarWire(starOptions);\n\n const filletOptions = new Bit.Inputs.OCCT.Fillet3DWireDto(star, undefined, [0, 1, 0], radiusList, indexes);\n const starFillet = await bitbybit.occt.fillets.fillet3DWire(filletOptions);\n\n const startFilletTranslated1 = await bitbybit.occt.transforms.translate({ shape: starFillet, translation: [0, 5, 0] })\n const startFilletTranslated2 = await bitbybit.occt.transforms.translate({ shape: starFillet, translation: [0, 10, 0] })\n\n\n const starFace = await bitbybit.occt.shapes.face.createFaceFromWire({ shape: startFilletTranslated2, planar: false });\n const starThick = await bitbybit.occt.operations.makeThickSolidSimple({ shape: starFace, offset: -1 });\n const starThickFillet = await bitbybit.occt.fillets.filletEdges({ shape: starThick, radius: 0.3 });\n\n const drawOptions = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n drawOptions.edgeWidth = 15;\n bitbybit.draw.drawAnyAsync({ entity: star, options: drawOptions });\n bitbybit.draw.drawAnyAsync({ entity: startFilletTranslated1, options: drawOptions });\n drawOptions.faceColour = \"#5555ff\";\n drawOptions.edgeColour = \"#000000\";\n drawOptions.edgeWidth = 2;\n drawOptions.precision = 0.005;\n bitbybit.draw.drawAnyAsync({ entity: starThickFillet, options: drawOptions });\n\n const gridOptions = new Bit.Inputs.Draw.SceneDrawGridMeshDto();\n bitbybit.draw.drawGridMesh(gridOptions);\n const skyboxOptions = new Bit.Inputs.BabylonScene.SkyboxDto();\n skyboxOptions.skybox = Bit.Inputs.Base.skyboxEnum.clearSky;\n bitbybit.babylon.scene.enableSkybox(skyboxOptions);\n}\n\nstart();\n","version":"0.21.0","type":"typescript"}} title="Fillet 3D Wire Specific Corners" /> **Blockly Example: Fillet Specific Corners of a 3D Wire** nrRaysinnerFilletRadiusouterRadiusFilletfilletIndexesradiusLististarPromisestarFilletPromisenrRays7innerFilletRadius1.7outerRadiusFillet0.6filletIndexes11MULTIPLYnrRays2'clearSky'10000.10.7radiusListi1MULTIPLYnrRays21EQi20INSERTLASTradiusListouterRadiusFilletINSERTLASTradiusListinnerFilletRadiusstarPromise000010nrRays1044FALSEstarFilletPromisestarPromiseradiusListfilletIndexes010starPromise0.01FALSE#ff0000TRUE#ffffff15starFilletPromise0500.01FALSE#ff0000TRUE#ffffff15starFilletPromise0100FALSE-10.30.005TRUE#3333ffTRUE#000000240040010100.450.50.5FALSE#ffffff#ffffff","version":"0.20.14","type":"blockly"}} + script={{"script":"nrRaysinnerFilletRadiusouterRadiusFilletfilletIndexesradiusLististarPromisestarFilletPromisenrRays7innerFilletRadius1.7outerRadiusFillet0.6filletIndexes11MULTIPLYnrRays2'clearSky'10000.10.7radiusListi1MULTIPLYnrRays21EQi20INSERTLASTradiusListouterRadiusFilletINSERTLASTradiusListinnerFilletRadiusstarPromise000010nrRays1044FALSEstarFilletPromisestarPromiseradiusListfilletIndexes010starPromise0.01FALSE#ff0000TRUE#ffffff15starFilletPromise0500.01FALSE#ff0000TRUE#ffffff15starFilletPromise0100FALSE-10.30.005TRUE#3333ffTRUE#000000240040010100.450.50.5FALSE#ffffff#ffffff","version":"0.21.0","type":"blockly"}} title="Fillet 3D Wire Specific Corners" /> **Rete Example: Fillet Specific Corners of a 3D Wire** diff --git a/docs/learn/code/common/occt/fillets/fillets-intro.mdx b/docs/learn/code/common/occt/fillets/fillets-intro.mdx index 1719dc04..935b73e4 100644 --- a/docs/learn/code/common/occt/fillets/fillets-intro.mdx +++ b/docs/learn/code/common/occt/fillets/fillets-intro.mdx @@ -43,21 +43,21 @@ The following examples in TypeScript, Rete, and Blockly demonstrate creating a s **TypeScript Example: Fillet All Edges of a Solid** {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n const filleted = await bitbybit.occt.fillets.filletEdges({\n shape: box,\n radius: 1,\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: filleted,\n });\n}\n\nstart();\n","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = async () => {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n const filleted = await bitbybit.occt.fillets.filletEdges({\n shape: box,\n radius: 1,\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: filleted,\n });\n}\n\nstart();\n","version":"0.21.0","type":"typescript"}} title="Fillet Solid" /> **Blockly Example: Fillet All Edges of a Solid** 58100001","version":"0.20.14","type":"blockly"}} + script={{"script":"58100001","version":"0.21.0","type":"blockly"}} title="Fillet Solid" /> **Rete Example: Fillet All Edges of a Solid** diff --git a/docs/learn/code/common/occt/fillets/fillets-on-2d-wire-corners.mdx b/docs/learn/code/common/occt/fillets/fillets-on-2d-wire-corners.mdx index 919a7a95..da8546ea 100644 --- a/docs/learn/code/common/occt/fillets/fillets-on-2d-wire-corners.mdx +++ b/docs/learn/code/common/occt/fillets/fillets-on-2d-wire-corners.mdx @@ -30,21 +30,21 @@ The examples below demonstrate creating a 2D wire and then applying fillets with **TypeScript Example: Fillet Specific Corners of a Wire with Variable Radii** {\n const squareOpt = new Bit.Inputs.OCCT.SquareDto();\n const square = await bitbybit.occt.shapes.wire.createSquareWire(squareOpt);\n const squareFillet = await bitbybit.occt.fillets.fillet2d({\n shape: square,\n radiusList: [0.1, 0.3],\n indexes: [1, 3]\n });\n\n bitbybit.draw.drawAnyAsync({\n entity: squareFillet\n });\n}\n\nstart();\n","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = async () => {\n const squareOpt = new Bit.Inputs.OCCT.SquareDto();\n const square = await bitbybit.occt.shapes.wire.createSquareWire(squareOpt);\n const squareFillet = await bitbybit.occt.fillets.fillet2d({\n shape: square,\n radiusList: [0.1, 0.3],\n indexes: [1, 3]\n });\n\n bitbybit.draw.drawAnyAsync({\n entity: squareFillet\n });\n}\n\nstart();\n","version":"0.21.0","type":"typescript"}} title="Fillet Specific Corners of Wire" /> **Blockly Example: Fillet Specific Corners of a Wire with Variable Radii** 10000100.10.313","version":"0.20.14","type":"blockly"}} + script={{"script":"10000100.10.313","version":"0.21.0","type":"blockly"}} title="Fillet Specific Corners of Wire" /> **Rete Example: Fillet Specific Corners of a Wire with Variable Radii** diff --git a/docs/learn/code/common/occt/fillets/fillets-on-2d-wires.mdx b/docs/learn/code/common/occt/fillets/fillets-on-2d-wires.mdx index 40835027..eb75e3d2 100644 --- a/docs/learn/code/common/occt/fillets/fillets-on-2d-wires.mdx +++ b/docs/learn/code/common/occt/fillets/fillets-on-2d-wires.mdx @@ -29,21 +29,21 @@ The examples below demonstrate how to create a simple 2D wire (e.g., a polyline **TypeScript Example: Fillet All Corners of a Wire** {\n const squareOpt = new Bit.Inputs.OCCT.SquareDto();\n const square = await bitbybit.occt.shapes.wire.createSquareWire(squareOpt);\n const squareFillet = await bitbybit.occt.fillets.fillet2d({\n shape: square,\n radius: 0.25\n });\n\n bitbybit.draw.drawAnyAsync({\n entity: squareFillet\n });\n}\n\nstart();\n","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = async () => {\n const squareOpt = new Bit.Inputs.OCCT.SquareDto();\n const square = await bitbybit.occt.shapes.wire.createSquareWire(squareOpt);\n const squareFillet = await bitbybit.occt.fillets.fillet2d({\n shape: square,\n radius: 0.25\n });\n\n bitbybit.draw.drawAnyAsync({\n entity: squareFillet\n });\n}\n\nstart();\n","version":"0.21.0","type":"typescript"}} title="Fillet All Corners of Wire" /> **Blockly Example: Fillet All Corners of a Wire** 10000100.24","version":"0.20.14","type":"blockly"}} + script={{"script":"10000100.24","version":"0.21.0","type":"blockly"}} title="Fillet All Corners of Wire" /> **Rete Example: Fillet All Corners of a Wire** diff --git a/docs/learn/code/common/occt/fillets/fillets-var-radius-on-spec-edges.mdx b/docs/learn/code/common/occt/fillets/fillets-var-radius-on-spec-edges.mdx index f210a0d9..282bc92c 100644 --- a/docs/learn/code/common/occt/fillets/fillets-var-radius-on-spec-edges.mdx +++ b/docs/learn/code/common/occt/fillets/fillets-var-radius-on-spec-edges.mdx @@ -31,7 +31,7 @@ The examples below demonstrate creating a solid box and then applying fillets wi **TypeScript Example: Fillet Specific Edges with Variable Radii** {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n const filleted = await bitbybit.occt.fillets.filletEdges({\n shape: box,\n radiusList: [1, 2, 0.3],\n indexes: [1, 2, 3]\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: filleted,\n });\n}\n\nstart();\n","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = async () => {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n const filleted = await bitbybit.occt.fillets.filletEdges({\n shape: box,\n radiusList: [1, 2, 0.3],\n indexes: [1, 2, 3]\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: filleted,\n });\n}\n\nstart();\n","version":"0.21.0","type":"typescript"}} title="Variable Fillet Radius On Spec Edges" /> @@ -39,7 +39,7 @@ The examples below demonstrate creating a solid box and then applying fillets wi **Blockly Example: Fillet Specific Edges with Variable Radii** 5810000120.3123","version":"0.20.14","type":"blockly"}} + script={{"script":"5810000120.3123","version":"0.21.0","type":"blockly"}} title="Variable Fillet Radius On Spec Edges" /> @@ -47,7 +47,7 @@ The examples below demonstrate creating a solid box and then applying fillets wi **Rete Example: Fillet Specific Edges with Variable Radii** diff --git a/docs/learn/code/common/occt/io/dxf-file-format-for-2d-drawings.md b/docs/learn/code/common/occt/io/dxf-file-format-for-2d-drawings.md index 3b13ae66..17364a1e 100644 --- a/docs/learn/code/common/occt/io/dxf-file-format-for-2d-drawings.md +++ b/docs/learn/code/common/occt/io/dxf-file-format-for-2d-drawings.md @@ -36,21 +36,21 @@ It's worth noting that while DXF is an extensive format with numerous entity typ fontUrlorangeColorpurpleColorgreenColortext1text1Compoundtext1WiresfilletedWireswirefilletedWiretext1Compound2dxfPaths1dxfLayer1text2text2Compoundtext2Wirestext2Compound2dxfPaths2dxfLayer2hexagonshexagonsCompounddxfPaths3dxfLayer3allLayersdxfFilefontUrlhttps://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@latest/fonts/Tektur/Tektur-Bold.ttforangeColor#ffa200purpleColor#cc80ffgreenColor#80ff00text1DXF @ bitbybit.devfontUrl1.50180002.5010centerMiddletext1Compoundtext1compoundtext1Wirestext1CompoundfilletedWireswiretext1WiresfilletedWirewire0.05INSERTLASTfilletedWiresfilletedWiretext1Compound2filletedWiresdxfPaths1text1Compound20.10.12dxfLayer1dxfPaths1BitbybitorangeColortext2CAD PowerfontUrl1018000-2010centerMiddletext2Compoundtext2compoundtext2Wirestext2Compoundtext2Compound2text2WiresdxfPaths2text2Compound20.10.12dxfLayer2dxfPaths2CAD PowerpurpleColorhexagons1524010TRUE[0.8,0.3][0.8,0.3][true, true, false]hexagonsCompoundhexagonsdxfPaths3hexagonsCompound0.10.12dxfLayer3dxfPaths3Hexagons#002afaallLayersdxfLayer1dxfLayer2dxfLayer3dxfFileallLayersbitbybit-dev.dxfTRUEfilletedWires0.01FALSETRUEorangeColor5text2Wires0.01FALSETRUEpurpleColor3hexagonsCompound0.01FALSETRUEgreenColor3","version":"0.20.14","type":"blockly"}} + script={{"script":"fontUrlorangeColorpurpleColorgreenColortext1text1Compoundtext1WiresfilletedWireswirefilletedWiretext1Compound2dxfPaths1dxfLayer1text2text2Compoundtext2Wirestext2Compound2dxfPaths2dxfLayer2hexagonshexagonsCompounddxfPaths3dxfLayer3allLayersdxfFilefontUrlhttps://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@latest/fonts/Tektur/Tektur-Bold.ttforangeColor#ffa200purpleColor#cc80ffgreenColor#80ff00text1DXF @ bitbybit.devfontUrl1.50180002.5010centerMiddletext1Compoundtext1compoundtext1Wirestext1CompoundfilletedWireswiretext1WiresfilletedWirewire0.05INSERTLASTfilletedWiresfilletedWiretext1Compound2filletedWiresdxfPaths1text1Compound20.10.12dxfLayer1dxfPaths1BitbybitorangeColortext2CAD PowerfontUrl1018000-2010centerMiddletext2Compoundtext2compoundtext2Wirestext2Compoundtext2Compound2text2WiresdxfPaths2text2Compound20.10.12dxfLayer2dxfPaths2CAD PowerpurpleColorhexagons1524010TRUE[0.8,0.3][0.8,0.3][true, true, false]hexagonsCompoundhexagonsdxfPaths3hexagonsCompound0.10.12dxfLayer3dxfPaths3Hexagons#002afaallLayersdxfLayer1dxfLayer2dxfLayer3dxfFileallLayersbitbybit-dev.dxfTRUEfilletedWires0.01FALSETRUEorangeColor5text2Wires0.01FALSETRUEpurpleColor3hexagonsCompound0.01FALSETRUEgreenColor3","version":"0.21.0","type":"blockly"}} title="DXF Export with Layers" /> {\n // Font URL for text creation\n const fontUrl = \"https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@latest/fonts/Tektur/Tektur-Bold.ttf\";\n\n // Define colors\n const orangeColor = \"#ffa200\";\n const purpleColor = \"#cc80ff\";\n const blueColor = \"#80ff00\";\n\n // Create first text: \"DXF @ bitbybit.dev\" at z=2.5\n const text1Options = new Text3DUrlDto();\n text1Options.text = \"DXF @ bitbybit.dev\";\n text1Options.fontUrl = fontUrl;\n text1Options.fontSize = 1.5;\n text1Options.height = 0;\n text1Options.rotation = 180;\n text1Options.origin = [0, 0, 2.5] as Point3;\n text1Options.direction = [0, 1, 0] as Vector3;\n\n const text1 = await bitbybit.advanced.text3d.createWithUrl(text1Options);\n const text1Compound = text1.compound;\n\n // Get wires from the first text\n const text1Wires: TopoDSWirePointer[] = await bitbybit.occt.shapes.wire.getWires({ shape: text1Compound });\n\n // Apply fillet to each wire\n const filletedWires: TopoDSWirePointer[] = [];\n for (const wire of text1Wires) {\n const filletOptions = new FilletDto();\n filletOptions.shape = wire;\n filletOptions.radius = 0.05;\n\n const filletedWire = await bitbybit.occt.fillets.fillet2d(filletOptions);\n filletedWires.push(filletedWire);\n }\n\n // Create compound from filleted wires\n const text1Compound2 = await bitbybit.occt.shapes.compound.makeCompound({ shapes: filletedWires });\n\n // Convert first text to DXF paths\n const dxfPaths1Options = new ShapeToDxfPathsDto();\n dxfPaths1Options.shape = text1Compound2;\n dxfPaths1Options.angularDeflection = 0.1;\n dxfPaths1Options.curvatureDeflection = 0.1;\n dxfPaths1Options.minimumOfPoints = 2;\n\n const dxfPaths1 = await bitbybit.occt.io.shapeToDxfPaths(dxfPaths1Options);\n\n // Create layer for first text\n const dxfLayer1Options = new DxfPathsWithLayerDto();\n dxfLayer1Options.paths = dxfPaths1;\n dxfLayer1Options.layer = \"Bitbybit\";\n dxfLayer1Options.color = orangeColor;\n\n const dxfLayer1 = await bitbybit.occt.io.dxfPathsWithLayer(dxfLayer1Options);\n\n // Create second text: \"CAD Power\" at z=-2\n const text2Options = new Text3DUrlDto();\n text2Options.text = \"CAD Power\";\n text2Options.fontUrl = fontUrl;\n text2Options.fontSize = 1;\n text2Options.height = 0;\n text2Options.rotation = 180;\n text2Options.origin = [0, 0, -2] as Point3;\n text2Options.direction = [0, 1, 0] as Vector3;\n\n const text2 = await bitbybit.advanced.text3d.createWithUrl(text2Options);\n const text2Compound = text2.compound;\n\n // Get wires from the second text\n const text2Wires: TopoDSWirePointer[] = await bitbybit.occt.shapes.wire.getWires({ shape: text2Compound });\n\n // Create compound from text2 wires (no fillet for second text)\n const text2Compound2 = await bitbybit.occt.shapes.compound.makeCompound({ shapes: text2Wires });\n\n // Convert second text to DXF paths\n const dxfPaths2Options = new ShapeToDxfPathsDto();\n dxfPaths2Options.shape = text2Compound2;\n dxfPaths2Options.angularDeflection = 0.1;\n dxfPaths2Options.curvatureDeflection = 0.1;\n dxfPaths2Options.minimumOfPoints = 2;\n\n const dxfPaths2 = await bitbybit.occt.io.shapeToDxfPaths(dxfPaths2Options);\n\n // Create layer for second text\n const dxfLayer2Options = new DxfPathsWithLayerDto();\n dxfLayer2Options.paths = dxfPaths2;\n dxfLayer2Options.layer = \"CAD Power\";\n dxfLayer2Options.color = purpleColor;\n\n const dxfLayer2 = await bitbybit.occt.io.dxfPathsWithLayer(dxfLayer2Options);\n\n // Create hexagonal grid\n const hexagonsOptions = new HexagonsInGridDto();\n hexagonsOptions.width = 15;\n hexagonsOptions.height = 2;\n hexagonsOptions.nrHexagonsInWidth = 40;\n hexagonsOptions.nrHexagonsInHeight = 10;\n hexagonsOptions.flatTop = true;\n hexagonsOptions.extendTop = false;\n hexagonsOptions.extendBottom = false;\n hexagonsOptions.extendLeft = false;\n hexagonsOptions.extendRight = false;\n hexagonsOptions.scalePatternWidth = [0.8, 0.3];\n hexagonsOptions.scalePatternHeight = [0.8, 0.3];\n hexagonsOptions.inclusionPattern = [true, true, false];\n\n const hexagons = await bitbybit.occt.shapes.wire.hexagonsInGrid(hexagonsOptions);\n\n // Create compound from hexagons\n const hexagonsCompound = await bitbybit.occt.shapes.compound.makeCompound({ shapes: hexagons });\n\n // Convert hexagons to DXF paths\n const dxfPaths3Options = new ShapeToDxfPathsDto();\n dxfPaths3Options.shape = hexagonsCompound;\n dxfPaths3Options.angularDeflection = 0.1;\n dxfPaths3Options.curvatureDeflection = 0.1;\n dxfPaths3Options.minimumOfPoints = 2;\n\n const dxfPaths3 = await bitbybit.occt.io.shapeToDxfPaths(dxfPaths3Options);\n\n // Create layer for hexagons\n const dxfLayer3Options = new DxfPathsWithLayerDto();\n dxfLayer3Options.paths = dxfPaths3;\n dxfLayer3Options.layer = \"Hexagons\";\n dxfLayer3Options.color = \"#002afa\";\n\n const dxfLayer3 = await bitbybit.occt.io.dxfPathsWithLayer(dxfLayer3Options);\n\n // Combine all layers\n const allLayers = [dxfLayer1, dxfLayer2, dxfLayer3];\n\n // Create DXF file\n const dxfCreateOptions = new DxfPathsPartsListDto();\n dxfCreateOptions.pathsParts = allLayers;\n dxfCreateOptions.fileName = \"bitbybit-dev.dxf\";\n dxfCreateOptions.tryDownload = true;\n\n await bitbybit.occt.io.dxfCreate(dxfCreateOptions);\n\n // Draw the shapes for visualization\n const drawOptions1 = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n drawOptions1.precision = 0.01;\n drawOptions1.drawFaces = false;\n drawOptions1.drawEdges = true;\n drawOptions1.edgeColour = orangeColor;\n drawOptions1.edgeWidth = 5;\n\n bitbybit.draw.drawAnyAsync({ entity: filletedWires, options: drawOptions1 });\n\n const drawOptions2 = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n drawOptions2.precision = 0.01;\n drawOptions2.drawFaces = false;\n drawOptions2.drawEdges = true;\n drawOptions2.edgeColour = purpleColor;\n drawOptions2.edgeWidth = 3;\n\n bitbybit.draw.drawAnyAsync({ entity: text2Wires, options: drawOptions2 });\n\n // Draw the shapes for visualization\n const drawOptions3 = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n drawOptions3.precision = 0.01;\n drawOptions3.drawFaces = false;\n drawOptions3.drawEdges = true;\n drawOptions3.edgeColour = blueColor;\n drawOptions3.edgeWidth = 2;\n\n bitbybit.draw.drawAnyAsync({ entity: hexagonsCompound, options: drawOptions3 });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const { Text3DUrlDto } = Bit.Advanced.Text3D;\nconst { ShapeToDxfPathsDto, DxfPathsWithLayerDto, DxfPathsPartsListDto } = Bit.Inputs.OCCT;\nconst { FilletDto } = Bit.Inputs.OCCT;\nconst { HexagonsInGridDto } = Bit.Inputs.OCCT;\n\n// Import required types\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Define the main function\nconst start = async () => {\n // Font URL for text creation\n const fontUrl = \"https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@latest/fonts/Tektur/Tektur-Bold.ttf\";\n\n // Define colors\n const orangeColor = \"#ffa200\";\n const purpleColor = \"#cc80ff\";\n const blueColor = \"#80ff00\";\n\n // Create first text: \"DXF @ bitbybit.dev\" at z=2.5\n const text1Options = new Text3DUrlDto();\n text1Options.text = \"DXF @ bitbybit.dev\";\n text1Options.fontUrl = fontUrl;\n text1Options.fontSize = 1.5;\n text1Options.height = 0;\n text1Options.rotation = 180;\n text1Options.origin = [0, 0, 2.5] as Point3;\n text1Options.direction = [0, 1, 0] as Vector3;\n\n const text1 = await bitbybit.advanced.text3d.createWithUrl(text1Options);\n const text1Compound = text1.compound;\n\n // Get wires from the first text\n const text1Wires: TopoDSWirePointer[] = await bitbybit.occt.shapes.wire.getWires({ shape: text1Compound });\n\n // Apply fillet to each wire\n const filletedWires: TopoDSWirePointer[] = [];\n for (const wire of text1Wires) {\n const filletOptions = new FilletDto();\n filletOptions.shape = wire;\n filletOptions.radius = 0.05;\n\n const filletedWire = await bitbybit.occt.fillets.fillet2d(filletOptions);\n filletedWires.push(filletedWire);\n }\n\n // Create compound from filleted wires\n const text1Compound2 = await bitbybit.occt.shapes.compound.makeCompound({ shapes: filletedWires });\n\n // Convert first text to DXF paths\n const dxfPaths1Options = new ShapeToDxfPathsDto();\n dxfPaths1Options.shape = text1Compound2;\n dxfPaths1Options.angularDeflection = 0.1;\n dxfPaths1Options.curvatureDeflection = 0.1;\n dxfPaths1Options.minimumOfPoints = 2;\n\n const dxfPaths1 = await bitbybit.occt.io.shapeToDxfPaths(dxfPaths1Options);\n\n // Create layer for first text\n const dxfLayer1Options = new DxfPathsWithLayerDto();\n dxfLayer1Options.paths = dxfPaths1;\n dxfLayer1Options.layer = \"Bitbybit\";\n dxfLayer1Options.color = orangeColor;\n\n const dxfLayer1 = await bitbybit.occt.io.dxfPathsWithLayer(dxfLayer1Options);\n\n // Create second text: \"CAD Power\" at z=-2\n const text2Options = new Text3DUrlDto();\n text2Options.text = \"CAD Power\";\n text2Options.fontUrl = fontUrl;\n text2Options.fontSize = 1;\n text2Options.height = 0;\n text2Options.rotation = 180;\n text2Options.origin = [0, 0, -2] as Point3;\n text2Options.direction = [0, 1, 0] as Vector3;\n\n const text2 = await bitbybit.advanced.text3d.createWithUrl(text2Options);\n const text2Compound = text2.compound;\n\n // Get wires from the second text\n const text2Wires: TopoDSWirePointer[] = await bitbybit.occt.shapes.wire.getWires({ shape: text2Compound });\n\n // Create compound from text2 wires (no fillet for second text)\n const text2Compound2 = await bitbybit.occt.shapes.compound.makeCompound({ shapes: text2Wires });\n\n // Convert second text to DXF paths\n const dxfPaths2Options = new ShapeToDxfPathsDto();\n dxfPaths2Options.shape = text2Compound2;\n dxfPaths2Options.angularDeflection = 0.1;\n dxfPaths2Options.curvatureDeflection = 0.1;\n dxfPaths2Options.minimumOfPoints = 2;\n\n const dxfPaths2 = await bitbybit.occt.io.shapeToDxfPaths(dxfPaths2Options);\n\n // Create layer for second text\n const dxfLayer2Options = new DxfPathsWithLayerDto();\n dxfLayer2Options.paths = dxfPaths2;\n dxfLayer2Options.layer = \"CAD Power\";\n dxfLayer2Options.color = purpleColor;\n\n const dxfLayer2 = await bitbybit.occt.io.dxfPathsWithLayer(dxfLayer2Options);\n\n // Create hexagonal grid\n const hexagonsOptions = new HexagonsInGridDto();\n hexagonsOptions.width = 15;\n hexagonsOptions.height = 2;\n hexagonsOptions.nrHexagonsInWidth = 40;\n hexagonsOptions.nrHexagonsInHeight = 10;\n hexagonsOptions.flatTop = true;\n hexagonsOptions.extendTop = false;\n hexagonsOptions.extendBottom = false;\n hexagonsOptions.extendLeft = false;\n hexagonsOptions.extendRight = false;\n hexagonsOptions.scalePatternWidth = [0.8, 0.3];\n hexagonsOptions.scalePatternHeight = [0.8, 0.3];\n hexagonsOptions.inclusionPattern = [true, true, false];\n\n const hexagons = await bitbybit.occt.shapes.wire.hexagonsInGrid(hexagonsOptions);\n\n // Create compound from hexagons\n const hexagonsCompound = await bitbybit.occt.shapes.compound.makeCompound({ shapes: hexagons });\n\n // Convert hexagons to DXF paths\n const dxfPaths3Options = new ShapeToDxfPathsDto();\n dxfPaths3Options.shape = hexagonsCompound;\n dxfPaths3Options.angularDeflection = 0.1;\n dxfPaths3Options.curvatureDeflection = 0.1;\n dxfPaths3Options.minimumOfPoints = 2;\n\n const dxfPaths3 = await bitbybit.occt.io.shapeToDxfPaths(dxfPaths3Options);\n\n // Create layer for hexagons\n const dxfLayer3Options = new DxfPathsWithLayerDto();\n dxfLayer3Options.paths = dxfPaths3;\n dxfLayer3Options.layer = \"Hexagons\";\n dxfLayer3Options.color = \"#002afa\";\n\n const dxfLayer3 = await bitbybit.occt.io.dxfPathsWithLayer(dxfLayer3Options);\n\n // Combine all layers\n const allLayers = [dxfLayer1, dxfLayer2, dxfLayer3];\n\n // Create DXF file\n const dxfCreateOptions = new DxfPathsPartsListDto();\n dxfCreateOptions.pathsParts = allLayers;\n dxfCreateOptions.fileName = \"bitbybit-dev.dxf\";\n dxfCreateOptions.tryDownload = true;\n\n await bitbybit.occt.io.dxfCreate(dxfCreateOptions);\n\n // Draw the shapes for visualization\n const drawOptions1 = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n drawOptions1.precision = 0.01;\n drawOptions1.drawFaces = false;\n drawOptions1.drawEdges = true;\n drawOptions1.edgeColour = orangeColor;\n drawOptions1.edgeWidth = 5;\n\n bitbybit.draw.drawAnyAsync({ entity: filletedWires, options: drawOptions1 });\n\n const drawOptions2 = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n drawOptions2.precision = 0.01;\n drawOptions2.drawFaces = false;\n drawOptions2.drawEdges = true;\n drawOptions2.edgeColour = purpleColor;\n drawOptions2.edgeWidth = 3;\n\n bitbybit.draw.drawAnyAsync({ entity: text2Wires, options: drawOptions2 });\n\n // Draw the shapes for visualization\n const drawOptions3 = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n drawOptions3.precision = 0.01;\n drawOptions3.drawFaces = false;\n drawOptions3.drawEdges = true;\n drawOptions3.edgeColour = blueColor;\n drawOptions3.edgeWidth = 2;\n\n bitbybit.draw.drawAnyAsync({ entity: hexagonsCompound, options: drawOptions3 });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="DXF Export with Layers" /> diff --git a/docs/learn/code/common/occt/modeling/festive-decor/frost-flower.md b/docs/learn/code/common/occt/modeling/festive-decor/frost-flower.md index f2bd3e64..342fdd9b 100644 --- a/docs/learn/code/common/occt/modeling/festive-decor/frost-flower.md +++ b/docs/learn/code/common/occt/modeling/festive-decor/frost-flower.md @@ -34,21 +34,21 @@ The algorithm: sizebranchWirecombinedWireouterWireinnerWirehollowFacesnowflakesize0.8branchWire0000.3MULTIPLY1.5size0-0.2MULTIPLY2.5size00.4MULTIPLY3.5size00MULTIPLY4size0FALSE0.00001combinedWirebranchWirebranchWire001180outerWirecombinedWire0.40.1innerWirecombinedWire0.20.1hollowFaceouterWireinnerWireTRUEsnowflakehollowFacehollowFace00130hollowFace00160hollowFace00190hollowFace001120hollowFace001150FALSEsnowflake000.20.01Ice Material#aed6f1#5dade20.10.31FALSE2FALSE#ffffff2","version":"0.20.12","type":"blockly"}} + script={{"script":"sizebranchWirecombinedWireouterWireinnerWirehollowFacesnowflakesize0.8branchWire0000.3MULTIPLY1.5size0-0.2MULTIPLY2.5size00.4MULTIPLY3.5size00MULTIPLY4size0FALSE0.00001combinedWirebranchWirebranchWire001180outerWirecombinedWire0.40.1innerWirecombinedWire0.20.1hollowFaceouterWireinnerWireTRUEsnowflakehollowFacehollowFace00130hollowFace00160hollowFace00190hollowFace001120hollowFace001150FALSEsnowflake000.20.01Ice Material#aed6f1#5dade20.10.31FALSE2FALSE#ffffff2","version":"0.21.0","type":"blockly"}} title="Star ornament with hanging hole" /> {\n const size = 0.8;\n\n const branchPoints: Point3[] = [\n [0, 0, 0],\n [0.3, 1.5 * size, 0],\n [-0.2, 2.5 * size, 0],\n [0.4, 3.5 * size, 0],\n [0, 4 * size, 0],\n ];\n\n const interpolation = new InterpolationDto();\n interpolation.points = branchPoints;\n interpolation.periodic = false;\n interpolation.tolerance = 0.00001;\n const branchWire = await wire.interpolatePoints(interpolation);\n\n const rotate180 = new RotateDto();\n rotate180.shape = branchWire;\n rotate180.axis = [0, 0, 1];\n rotate180.angle = 180;\n const branchWireRotated = await transforms.rotate(rotate180);\n\n const combine = new ShapesDto();\n combine.shapes = [branchWire, branchWireRotated];\n const combinedWire = await wire.combineEdgesAndWiresIntoAWire(combine);\n\n const offsetOuter = new OffsetDto();\n offsetOuter.shape = combinedWire;\n offsetOuter.distance = 0.4;\n offsetOuter.tolerance = 0.1;\n const outerWire = (await operations.offset(offsetOuter)) as unknown as TopoDSWirePointer;\n\n const offsetInner = new OffsetDto();\n offsetInner.shape = combinedWire;\n offsetInner.distance = 0.2;\n offsetInner.tolerance = 0.1;\n const innerWireRaw = (await operations.offset(offsetInner)) as unknown as TopoDSWirePointer;\n\n const reverse = new ShapeDto();\n reverse.shape = innerWireRaw;\n const innerWire = await wire.reversedWire(reverse);\n\n const faceFromWires = new FaceFromWiresDto();\n faceFromWires.shapes = [outerWire, innerWire];\n faceFromWires.planar = true;\n const hollowFace = await face.createFaceFromWires(faceFromWires);\n\n const angles = [0, 30, 60, 90, 120, 150];\n const rotatedFaces: TopoDSShapePointer[] = [];\n\n for (const angle of angles) {\n if (angle === 0) {\n rotatedFaces.push(hollowFace);\n continue;\n }\n const rotate = new RotateDto();\n rotate.shape = hollowFace;\n rotate.axis = [0, 0, 1];\n rotate.angle = angle;\n rotatedFaces.push(await transforms.rotate(rotate));\n }\n\n const union = new UnionDto();\n union.shapes = rotatedFaces;\n union.keepEdges = false;\n const snowflakeFace = await booleans.union(union);\n\n const extrude = new ExtrudeDto();\n extrude.shape = snowflakeFace;\n extrude.direction = [0, 0, 0.2];\n const snowflakeSolid = await operations.extrude(extrude);\n\n const materialOptions = new PBRMetallicRoughnessDto();\n materialOptions.name = 'Ice Material';\n materialOptions.baseColor = '#aed6f1';\n materialOptions.emissiveColor = '#5dade2';\n materialOptions.metallic = 0.1;\n materialOptions.roughness = 0.3;\n materialOptions.alpha = 1;\n materialOptions.backFaceCulling = false;\n materialOptions.zOffset = 2;\n const material = bitbybit.babylon.material.pbrMetallicRoughness.create(materialOptions);\n\n const drawOptions = new DrawOcctShapeOptions();\n drawOptions.precision = 0.01;\n drawOptions.drawEdges = false;\n drawOptions.edgeColour = '#ffffff';\n drawOptions.edgeWidth = 2;\n drawOptions.faceMaterial = material;\n\n const starMesh = await bitbybit.draw.drawAnyAsync({\n entity: snowflakeSolid,\n options: drawOptions,\n });\n\n const options = new ZoomOnDto();\n options.meshes = [starMesh];\n bitbybit.advanced.navigation.zoomOn(options);\n};\n\nstart();","version":"0.20.12","type":"typescript"}} + script={{"script":"const { InterpolationDto, RotateDto, ShapesDto, OffsetDto, FaceFromWiresDto, ExtrudeDto, UnionDto, ShapeDto } = Bit.Inputs.OCCT;\nconst { PBRMetallicRoughnessDto } = Bit.Inputs.BabylonMaterial;\nconst { DrawOcctShapeOptions } = Bit.Inputs.Draw;\nconst { ZoomOnDto } = Bit.Advanced.Navigation;\n\ntype Point3 = Bit.Inputs.Base.Point3;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer;\n\nconst { wire, face } = bitbybit.occt.shapes;\nconst { operations, transforms, booleans } = bitbybit.occt;\n\nconst start = async () => {\n const size = 0.8;\n\n const branchPoints: Point3[] = [\n [0, 0, 0],\n [0.3, 1.5 * size, 0],\n [-0.2, 2.5 * size, 0],\n [0.4, 3.5 * size, 0],\n [0, 4 * size, 0],\n ];\n\n const interpolation = new InterpolationDto();\n interpolation.points = branchPoints;\n interpolation.periodic = false;\n interpolation.tolerance = 0.00001;\n const branchWire = await wire.interpolatePoints(interpolation);\n\n const rotate180 = new RotateDto();\n rotate180.shape = branchWire;\n rotate180.axis = [0, 0, 1];\n rotate180.angle = 180;\n const branchWireRotated = await transforms.rotate(rotate180);\n\n const combine = new ShapesDto();\n combine.shapes = [branchWire, branchWireRotated];\n const combinedWire = await wire.combineEdgesAndWiresIntoAWire(combine);\n\n const offsetOuter = new OffsetDto();\n offsetOuter.shape = combinedWire;\n offsetOuter.distance = 0.4;\n offsetOuter.tolerance = 0.1;\n const outerWire = (await operations.offset(offsetOuter)) as unknown as TopoDSWirePointer;\n\n const offsetInner = new OffsetDto();\n offsetInner.shape = combinedWire;\n offsetInner.distance = 0.2;\n offsetInner.tolerance = 0.1;\n const innerWireRaw = (await operations.offset(offsetInner)) as unknown as TopoDSWirePointer;\n\n const reverse = new ShapeDto();\n reverse.shape = innerWireRaw;\n const innerWire = await wire.reversedWire(reverse);\n\n const faceFromWires = new FaceFromWiresDto();\n faceFromWires.shapes = [outerWire, innerWire];\n faceFromWires.planar = true;\n const hollowFace = await face.createFaceFromWires(faceFromWires);\n\n const angles = [0, 30, 60, 90, 120, 150];\n const rotatedFaces: TopoDSShapePointer[] = [];\n\n for (const angle of angles) {\n if (angle === 0) {\n rotatedFaces.push(hollowFace);\n continue;\n }\n const rotate = new RotateDto();\n rotate.shape = hollowFace;\n rotate.axis = [0, 0, 1];\n rotate.angle = angle;\n rotatedFaces.push(await transforms.rotate(rotate));\n }\n\n const union = new UnionDto();\n union.shapes = rotatedFaces;\n union.keepEdges = false;\n const snowflakeFace = await booleans.union(union);\n\n const extrude = new ExtrudeDto();\n extrude.shape = snowflakeFace;\n extrude.direction = [0, 0, 0.2];\n const snowflakeSolid = await operations.extrude(extrude);\n\n const materialOptions = new PBRMetallicRoughnessDto();\n materialOptions.name = 'Ice Material';\n materialOptions.baseColor = '#aed6f1';\n materialOptions.emissiveColor = '#5dade2';\n materialOptions.metallic = 0.1;\n materialOptions.roughness = 0.3;\n materialOptions.alpha = 1;\n materialOptions.backFaceCulling = false;\n materialOptions.zOffset = 2;\n const material = bitbybit.babylon.material.pbrMetallicRoughness.create(materialOptions);\n\n const drawOptions = new DrawOcctShapeOptions();\n drawOptions.precision = 0.01;\n drawOptions.drawEdges = false;\n drawOptions.edgeColour = '#ffffff';\n drawOptions.edgeWidth = 2;\n drawOptions.faceMaterial = material;\n\n const starMesh = await bitbybit.draw.drawAnyAsync({\n entity: snowflakeSolid,\n options: drawOptions,\n });\n\n const options = new ZoomOnDto();\n options.meshes = [starMesh];\n bitbybit.advanced.navigation.zoomOn(options);\n};\n\nstart();","version":"0.21.0","type":"typescript"}} title="Star ornament with hanging hole" /> diff --git a/docs/learn/code/common/occt/modeling/festive-decor/frozen-snowflake.md b/docs/learn/code/common/occt/modeling/festive-decor/frozen-snowflake.md index 5d35e5bf..3fc6fe4c 100644 --- a/docs/learn/code/common/occt/modeling/festive-decor/frozen-snowflake.md +++ b/docs/learn/code/common/occt/modeling/festive-decor/frozen-snowflake.md @@ -33,21 +33,21 @@ The algorithm: nrZigZagsinnerHex1outerHex1zigzag1zigzag1ScaledinnerHex2outerHex2zigzag2zigzag2Scaledloft1loft2loft2Translatedloft3faces1everySecondMaineverySecondEnd1faces2everySecondEnd2faces3facesListForExtrusioncurrentFaceallExtrudedFacesextrudedFaceallExtrudedFaces2currentFace2compound1compound2'city'10000.10.7TRUEnrZigZags5innerHex100.2001063outerHex100.2001063.7zigzag1innerHex1outerHex1nrZigZagsFALSEFALSETRUEzigzag1Scaledzigzag13innerHex200001062outerHex200001062.5zigzag2innerHex2outerHex2nrZigZagsFALSEFALSETRUEzigzag2Scaledzigzag26loft1zigzag2zigzag1zigzag1Scaledzigzag2ScaledFALSEFALSEFALSETRUE10FALSE31e-7approxCentripetalloft2zigzag2Scaledzigzag1ScaledFALSEFALSEFALSETRUE10FALSE31e-7approxCentripetalloft2Translatedloft200.30loft3zigzag2zigzag1FALSEFALSEFALSETRUE10FALSE31e-7approxCentripetalfaces1loft1everySecondMainfaces121TRUEeverySecondEnd1loft2Translatedfaces2everySecondEnd120TRUEeverySecondEnd2loft3faces3everySecondEnd220TRUEfacesListForExtrusioncurrentFacefaces2INSERTLASTfacesListForExtrusioncurrentFacecurrentFacefaces3INSERTLASTfacesListForExtrusioncurrentFaceallExtrudedFacescurrentFacefacesListForExtrusionextrudedFacecurrentFace00.30INSERTLASTallExtrudedFacesextrudedFaceallExtrudedFaces2currentFace2everySecondMainextrudedFacecurrentFace200.30INSERTLASTallExtrudedFaces2extrudedFacecompound1allExtrudedFaces2compound2allExtrudedFacescompound10.01Material 1#94b4ff#0000000.80.21FALSE2FALSE#ffffff4compound20.01Material 2#33ffc2#0000000.80.21FALSE0FALSE#ffffff2","version":"0.20.12","type":"blockly"}} + script={{"script":"nrZigZagsinnerHex1outerHex1zigzag1zigzag1ScaledinnerHex2outerHex2zigzag2zigzag2Scaledloft1loft2loft2Translatedloft3faces1everySecondMaineverySecondEnd1faces2everySecondEnd2faces3facesListForExtrusioncurrentFaceallExtrudedFacesextrudedFaceallExtrudedFaces2currentFace2compound1compound2'city'10000.10.7TRUEnrZigZags5innerHex100.2001063outerHex100.2001063.7zigzag1innerHex1outerHex1nrZigZagsFALSEFALSETRUEzigzag1Scaledzigzag13innerHex200001062outerHex200001062.5zigzag2innerHex2outerHex2nrZigZagsFALSEFALSETRUEzigzag2Scaledzigzag26loft1zigzag2zigzag1zigzag1Scaledzigzag2ScaledFALSEFALSEFALSETRUE10FALSE31e-7approxCentripetalloft2zigzag2Scaledzigzag1ScaledFALSEFALSEFALSETRUE10FALSE31e-7approxCentripetalloft2Translatedloft200.30loft3zigzag2zigzag1FALSEFALSEFALSETRUE10FALSE31e-7approxCentripetalfaces1loft1everySecondMainfaces121TRUEeverySecondEnd1loft2Translatedfaces2everySecondEnd120TRUEeverySecondEnd2loft3faces3everySecondEnd220TRUEfacesListForExtrusioncurrentFacefaces2INSERTLASTfacesListForExtrusioncurrentFacecurrentFacefaces3INSERTLASTfacesListForExtrusioncurrentFaceallExtrudedFacescurrentFacefacesListForExtrusionextrudedFacecurrentFace00.30INSERTLASTallExtrudedFacesextrudedFaceallExtrudedFaces2currentFace2everySecondMainextrudedFacecurrentFace200.30INSERTLASTallExtrudedFaces2extrudedFacecompound1allExtrudedFaces2compound2allExtrudedFacescompound10.01Material 1#94b4ff#0000000.80.21FALSE2FALSE#ffffff4compound20.01Material 2#33ffc2#0000000.80.21FALSE0FALSE#ffffff2","version":"0.21.0","type":"blockly"}} title="Frozen Snowflake" /> {\n const skyboxOpt = new SkyboxDto();\n skyboxOpt.skybox = skyboxEnum.city;\n skyboxOpt.hideSkybox = true;\n bitbybit.babylon.scene.enableSkybox(skyboxOpt);\n\n const nrZigZags = 5;\n\n // Create first set of hexagon wires\n const innerHex1Dto = new NGonWireDto();\n innerHex1Dto.center = [0, 0.2, 0];\n innerHex1Dto.direction = [0, 1, 0];\n innerHex1Dto.nrCorners = 6;\n innerHex1Dto.radius = 3;\n const innerHex1 = await wire.createNGonWire(innerHex1Dto);\n\n const outerHex1Dto = new NGonWireDto();\n outerHex1Dto.center = [0, 0.2, 0];\n outerHex1Dto.direction = [0, 1, 0];\n outerHex1Dto.nrCorners = 6;\n outerHex1Dto.radius = 3.7;\n const outerHex1 = await wire.createNGonWire(outerHex1Dto);\n\n const innerHex2Dto = new NGonWireDto();\n innerHex2Dto.center = [0, 0, 0];\n innerHex2Dto.direction = [0, 1, 0];\n innerHex2Dto.nrCorners = 6;\n innerHex2Dto.radius = 2;\n const innerHex2 = await wire.createNGonWire(innerHex2Dto);\n\n const outerHex2Dto = new NGonWireDto();\n outerHex2Dto.center = [0, 0, 0];\n outerHex2Dto.direction = [0, 1, 0];\n outerHex2Dto.nrCorners = 6;\n outerHex2Dto.radius = 2.5;\n const outerHex2 = await wire.createNGonWire(outerHex2Dto);\n\n // Create zigzag wires between hexagons\n const zigzag1Dto = new ZigZagBetweenTwoWiresDto();\n zigzag1Dto.wire1 = innerHex1;\n zigzag1Dto.wire2 = outerHex1;\n zigzag1Dto.nrZigZags = nrZigZags;\n zigzag1Dto.inverse = false;\n zigzag1Dto.divideByEqualDistance = false;\n zigzag1Dto.zigZagsPerEdge = true;\n const zigzag1 = await wire.createZigZagBetweenTwoWires(zigzag1Dto);\n\n const scale1Dto = new ScaleDto();\n scale1Dto.shape = zigzag1;\n scale1Dto.factor = 3;\n const zigzag1Scaled = await transforms.scale(scale1Dto);\n\n const zigzag2Dto = new ZigZagBetweenTwoWiresDto();\n zigzag2Dto.wire1 = innerHex2;\n zigzag2Dto.wire2 = outerHex2;\n zigzag2Dto.nrZigZags = nrZigZags;\n zigzag2Dto.inverse = false;\n zigzag2Dto.divideByEqualDistance = false;\n zigzag2Dto.zigZagsPerEdge = true;\n const zigzag2 = await wire.createZigZagBetweenTwoWires(zigzag2Dto);\n\n const scale2Dto = new ScaleDto();\n scale2Dto.shape = zigzag2;\n scale2Dto.factor = 6;\n const zigzag2Scaled = await transforms.scale(scale2Dto);\n\n // Create loft surfaces\n const loft1Dto = new LoftAdvancedDto();\n loft1Dto.shapes = [zigzag2, zigzag1, zigzag1Scaled, zigzag2Scaled];\n loft1Dto.makeSolid = false;\n loft1Dto.closed = false;\n loft1Dto.periodic = false;\n loft1Dto.straight = true;\n loft1Dto.nrPeriodicSections = 10;\n loft1Dto.useSmoothing = false;\n loft1Dto.maxUDegree = 3;\n loft1Dto.tolerance = 1e-7;\n loft1Dto.parType = approxParametrizationTypeEnum.approxCentripetal;\n const loft1 = await operations.loftAdvanced(loft1Dto);\n\n const loft2Dto = new LoftAdvancedDto();\n loft2Dto.shapes = [zigzag2Scaled, zigzag1Scaled];\n loft2Dto.makeSolid = false;\n loft2Dto.closed = false;\n loft2Dto.periodic = false;\n loft2Dto.straight = true;\n loft2Dto.nrPeriodicSections = 10;\n loft2Dto.useSmoothing = false;\n loft2Dto.maxUDegree = 3;\n loft2Dto.tolerance = 1e-7;\n loft1Dto.parType = approxParametrizationTypeEnum.approxCentripetal;\n const loft2 = await operations.loftAdvanced(loft2Dto);\n\n const translateDto = new TranslateDto();\n translateDto.shape = loft2;\n translateDto.translation = [0, 0.3, 0];\n const loft2Translated = await transforms.translate(translateDto);\n\n const loft3Dto = new LoftAdvancedDto();\n loft3Dto.shapes = [zigzag2, zigzag1];\n loft3Dto.makeSolid = false;\n loft3Dto.closed = false;\n loft3Dto.periodic = false;\n loft3Dto.straight = true;\n loft3Dto.nrPeriodicSections = 10;\n loft3Dto.useSmoothing = false;\n loft3Dto.maxUDegree = 3;\n loft3Dto.tolerance = 1e-7;\n loft1Dto.parType = approxParametrizationTypeEnum.approxCentripetal;\n const loft3 = await operations.loftAdvanced(loft3Dto);\n\n // Extract and filter faces\n const faces1All = await face.getFaces({ shape: loft1 });\n const everySecondMain = bitbybit.lists.getNthItem({\n list: faces1All,\n nth: 2,\n offset: 1,\n clone: true\n });\n\n const faces2All = await face.getFaces({ shape: loft2Translated });\n const everySecondEnd1 = bitbybit.lists.getNthItem({\n list: faces2All,\n nth: 2,\n offset: 0,\n clone: true\n });\n\n const faces3All = await face.getFaces({ shape: loft3 });\n const everySecondEnd2 = bitbybit.lists.getNthItem({\n list: faces3All,\n nth: 2,\n offset: 0,\n clone: true\n });\n\n // Combine faces for extrusion\n const facesForExtrusion: TopoDSFacePointer[] = [\n ...everySecondEnd1,\n ...everySecondEnd2\n ];\n\n // Extrude all faces\n const extrudedFaces: TopoDSShapePointer[] = [];\n for (const faceToExtrude of facesForExtrusion) {\n const extrudeDto = new ExtrudeDto();\n extrudeDto.shape = faceToExtrude;\n extrudeDto.direction = [0, 0.3, 0];\n const extruded = await operations.extrude(extrudeDto);\n extrudedFaces.push(extruded);\n }\n\n const extrudedFacesMain: TopoDSShapePointer[] = [];\n for (const faceToExtrude of everySecondMain) {\n const extrudeDto = new ExtrudeDto();\n extrudeDto.shape = faceToExtrude;\n extrudeDto.direction = [0, 0.3, 0];\n const extruded = await operations.extrude(extrudeDto);\n extrudedFacesMain.push(extruded);\n }\n\n // Create compounds\n const compoundDto1 = new ShapesDto();\n compoundDto1.shapes = extrudedFacesMain;\n const compound1 = await compound.makeCompound(compoundDto1);\n\n const compoundDto2 = new ShapesDto();\n compoundDto2.shapes = extrudedFaces;\n const compound2 = await compound.makeCompound(compoundDto2);\n\n // Create materials\n const material1Dto = new PBRMetallicRoughnessDto();\n material1Dto.name = 'Material 1';\n material1Dto.baseColor = '#94b4ff';\n material1Dto.emissiveColor = '#000000';\n material1Dto.metallic = 0.8;\n material1Dto.roughness = 0.2;\n material1Dto.alpha = 1;\n material1Dto.backFaceCulling = false;\n material1Dto.zOffset = 2;\n const material1 = bitbybit.babylon.material.pbrMetallicRoughness.create(material1Dto);\n\n const material2Dto = new PBRMetallicRoughnessDto();\n material2Dto.name = 'Material 2';\n material2Dto.baseColor = '#33ffc2';\n material2Dto.emissiveColor = '#000000';\n material2Dto.metallic = 0.8;\n material2Dto.roughness = 0.2;\n material2Dto.alpha = 1;\n material2Dto.backFaceCulling = false;\n material2Dto.zOffset = 0;\n const material2 = bitbybit.babylon.material.pbrMetallicRoughness.create(material2Dto);\n\n // Draw the compounds\n const drawOptions1 = new DrawOcctShapeOptions();\n drawOptions1.precision = 0.01;\n drawOptions1.faceMaterial = material1;\n drawOptions1.drawEdges = false;\n drawOptions1.edgeColour = '#ffffff';\n drawOptions1.edgeWidth = 4;\n\n await bitbybit.draw.drawAnyAsync({\n entity: compound1,\n options: drawOptions1\n });\n\n const drawOptions2 = new DrawOcctShapeOptions();\n drawOptions2.precision = 0.01;\n drawOptions2.faceMaterial = material2;\n drawOptions2.drawEdges = false;\n drawOptions2.edgeColour = '#ffffff';\n drawOptions2.edgeWidth = 2;\n\n const drawnMesh = await bitbybit.draw.drawAnyAsync({\n entity: compound2,\n options: drawOptions2\n });\n\n const zoomOnOptions = new ZoomOnDto();\n zoomOnOptions.offset = -0.1;\n zoomOnOptions.meshes = [drawnMesh];\n bitbybit.advanced.navigation.zoomOn(zoomOnOptions);\n};\n\nstart();","version":"0.20.12","type":"typescript"}} + script={{"script":"const { NGonWireDto, ZigZagBetweenTwoWiresDto, ShapesDto, ExtrudeDto, approxParametrizationTypeEnum } = Bit.Inputs.OCCT;\nconst { LoftAdvancedDto } = Bit.Inputs.OCCT;\nconst { TranslateDto, ScaleDto } = Bit.Inputs.OCCT;\nconst { PBRMetallicRoughnessDto } = Bit.Inputs.BabylonMaterial;\nconst { DrawOcctShapeOptions } = Bit.Inputs.Draw;\nconst { SkyboxDto } = Bit.Inputs.BabylonScene;\nconst { skyboxEnum } = Bit.Inputs.Base;\nconst { ZoomOnDto } = Bit.Advanced.Navigation;\n\ntype Point3 = Bit.Inputs.Base.Point3;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer;\n\nconst { wire, face, compound } = bitbybit.occt.shapes;\nconst { operations, transforms } = bitbybit.occt;\n\nconst start = async () => {\n const skyboxOpt = new SkyboxDto();\n skyboxOpt.skybox = skyboxEnum.city;\n skyboxOpt.hideSkybox = true;\n bitbybit.babylon.scene.enableSkybox(skyboxOpt);\n\n const nrZigZags = 5;\n\n // Create first set of hexagon wires\n const innerHex1Dto = new NGonWireDto();\n innerHex1Dto.center = [0, 0.2, 0];\n innerHex1Dto.direction = [0, 1, 0];\n innerHex1Dto.nrCorners = 6;\n innerHex1Dto.radius = 3;\n const innerHex1 = await wire.createNGonWire(innerHex1Dto);\n\n const outerHex1Dto = new NGonWireDto();\n outerHex1Dto.center = [0, 0.2, 0];\n outerHex1Dto.direction = [0, 1, 0];\n outerHex1Dto.nrCorners = 6;\n outerHex1Dto.radius = 3.7;\n const outerHex1 = await wire.createNGonWire(outerHex1Dto);\n\n const innerHex2Dto = new NGonWireDto();\n innerHex2Dto.center = [0, 0, 0];\n innerHex2Dto.direction = [0, 1, 0];\n innerHex2Dto.nrCorners = 6;\n innerHex2Dto.radius = 2;\n const innerHex2 = await wire.createNGonWire(innerHex2Dto);\n\n const outerHex2Dto = new NGonWireDto();\n outerHex2Dto.center = [0, 0, 0];\n outerHex2Dto.direction = [0, 1, 0];\n outerHex2Dto.nrCorners = 6;\n outerHex2Dto.radius = 2.5;\n const outerHex2 = await wire.createNGonWire(outerHex2Dto);\n\n // Create zigzag wires between hexagons\n const zigzag1Dto = new ZigZagBetweenTwoWiresDto();\n zigzag1Dto.wire1 = innerHex1;\n zigzag1Dto.wire2 = outerHex1;\n zigzag1Dto.nrZigZags = nrZigZags;\n zigzag1Dto.inverse = false;\n zigzag1Dto.divideByEqualDistance = false;\n zigzag1Dto.zigZagsPerEdge = true;\n const zigzag1 = await wire.createZigZagBetweenTwoWires(zigzag1Dto);\n\n const scale1Dto = new ScaleDto();\n scale1Dto.shape = zigzag1;\n scale1Dto.factor = 3;\n const zigzag1Scaled = await transforms.scale(scale1Dto);\n\n const zigzag2Dto = new ZigZagBetweenTwoWiresDto();\n zigzag2Dto.wire1 = innerHex2;\n zigzag2Dto.wire2 = outerHex2;\n zigzag2Dto.nrZigZags = nrZigZags;\n zigzag2Dto.inverse = false;\n zigzag2Dto.divideByEqualDistance = false;\n zigzag2Dto.zigZagsPerEdge = true;\n const zigzag2 = await wire.createZigZagBetweenTwoWires(zigzag2Dto);\n\n const scale2Dto = new ScaleDto();\n scale2Dto.shape = zigzag2;\n scale2Dto.factor = 6;\n const zigzag2Scaled = await transforms.scale(scale2Dto);\n\n // Create loft surfaces\n const loft1Dto = new LoftAdvancedDto();\n loft1Dto.shapes = [zigzag2, zigzag1, zigzag1Scaled, zigzag2Scaled];\n loft1Dto.makeSolid = false;\n loft1Dto.closed = false;\n loft1Dto.periodic = false;\n loft1Dto.straight = true;\n loft1Dto.nrPeriodicSections = 10;\n loft1Dto.useSmoothing = false;\n loft1Dto.maxUDegree = 3;\n loft1Dto.tolerance = 1e-7;\n loft1Dto.parType = approxParametrizationTypeEnum.approxCentripetal;\n const loft1 = await operations.loftAdvanced(loft1Dto);\n\n const loft2Dto = new LoftAdvancedDto();\n loft2Dto.shapes = [zigzag2Scaled, zigzag1Scaled];\n loft2Dto.makeSolid = false;\n loft2Dto.closed = false;\n loft2Dto.periodic = false;\n loft2Dto.straight = true;\n loft2Dto.nrPeriodicSections = 10;\n loft2Dto.useSmoothing = false;\n loft2Dto.maxUDegree = 3;\n loft2Dto.tolerance = 1e-7;\n loft1Dto.parType = approxParametrizationTypeEnum.approxCentripetal;\n const loft2 = await operations.loftAdvanced(loft2Dto);\n\n const translateDto = new TranslateDto();\n translateDto.shape = loft2;\n translateDto.translation = [0, 0.3, 0];\n const loft2Translated = await transforms.translate(translateDto);\n\n const loft3Dto = new LoftAdvancedDto();\n loft3Dto.shapes = [zigzag2, zigzag1];\n loft3Dto.makeSolid = false;\n loft3Dto.closed = false;\n loft3Dto.periodic = false;\n loft3Dto.straight = true;\n loft3Dto.nrPeriodicSections = 10;\n loft3Dto.useSmoothing = false;\n loft3Dto.maxUDegree = 3;\n loft3Dto.tolerance = 1e-7;\n loft1Dto.parType = approxParametrizationTypeEnum.approxCentripetal;\n const loft3 = await operations.loftAdvanced(loft3Dto);\n\n // Extract and filter faces\n const faces1All = await face.getFaces({ shape: loft1 });\n const everySecondMain = bitbybit.lists.getNthItem({\n list: faces1All,\n nth: 2,\n offset: 1,\n clone: true\n });\n\n const faces2All = await face.getFaces({ shape: loft2Translated });\n const everySecondEnd1 = bitbybit.lists.getNthItem({\n list: faces2All,\n nth: 2,\n offset: 0,\n clone: true\n });\n\n const faces3All = await face.getFaces({ shape: loft3 });\n const everySecondEnd2 = bitbybit.lists.getNthItem({\n list: faces3All,\n nth: 2,\n offset: 0,\n clone: true\n });\n\n // Combine faces for extrusion\n const facesForExtrusion: TopoDSFacePointer[] = [\n ...everySecondEnd1,\n ...everySecondEnd2\n ];\n\n // Extrude all faces\n const extrudedFaces: TopoDSShapePointer[] = [];\n for (const faceToExtrude of facesForExtrusion) {\n const extrudeDto = new ExtrudeDto();\n extrudeDto.shape = faceToExtrude;\n extrudeDto.direction = [0, 0.3, 0];\n const extruded = await operations.extrude(extrudeDto);\n extrudedFaces.push(extruded);\n }\n\n const extrudedFacesMain: TopoDSShapePointer[] = [];\n for (const faceToExtrude of everySecondMain) {\n const extrudeDto = new ExtrudeDto();\n extrudeDto.shape = faceToExtrude;\n extrudeDto.direction = [0, 0.3, 0];\n const extruded = await operations.extrude(extrudeDto);\n extrudedFacesMain.push(extruded);\n }\n\n // Create compounds\n const compoundDto1 = new ShapesDto();\n compoundDto1.shapes = extrudedFacesMain;\n const compound1 = await compound.makeCompound(compoundDto1);\n\n const compoundDto2 = new ShapesDto();\n compoundDto2.shapes = extrudedFaces;\n const compound2 = await compound.makeCompound(compoundDto2);\n\n // Create materials\n const material1Dto = new PBRMetallicRoughnessDto();\n material1Dto.name = 'Material 1';\n material1Dto.baseColor = '#94b4ff';\n material1Dto.emissiveColor = '#000000';\n material1Dto.metallic = 0.8;\n material1Dto.roughness = 0.2;\n material1Dto.alpha = 1;\n material1Dto.backFaceCulling = false;\n material1Dto.zOffset = 2;\n const material1 = bitbybit.babylon.material.pbrMetallicRoughness.create(material1Dto);\n\n const material2Dto = new PBRMetallicRoughnessDto();\n material2Dto.name = 'Material 2';\n material2Dto.baseColor = '#33ffc2';\n material2Dto.emissiveColor = '#000000';\n material2Dto.metallic = 0.8;\n material2Dto.roughness = 0.2;\n material2Dto.alpha = 1;\n material2Dto.backFaceCulling = false;\n material2Dto.zOffset = 0;\n const material2 = bitbybit.babylon.material.pbrMetallicRoughness.create(material2Dto);\n\n // Draw the compounds\n const drawOptions1 = new DrawOcctShapeOptions();\n drawOptions1.precision = 0.01;\n drawOptions1.faceMaterial = material1;\n drawOptions1.drawEdges = false;\n drawOptions1.edgeColour = '#ffffff';\n drawOptions1.edgeWidth = 4;\n\n await bitbybit.draw.drawAnyAsync({\n entity: compound1,\n options: drawOptions1\n });\n\n const drawOptions2 = new DrawOcctShapeOptions();\n drawOptions2.precision = 0.01;\n drawOptions2.faceMaterial = material2;\n drawOptions2.drawEdges = false;\n drawOptions2.edgeColour = '#ffffff';\n drawOptions2.edgeWidth = 2;\n\n const drawnMesh = await bitbybit.draw.drawAnyAsync({\n entity: compound2,\n options: drawOptions2\n });\n\n const zoomOnOptions = new ZoomOnDto();\n zoomOnOptions.offset = -0.1;\n zoomOnOptions.meshes = [drawnMesh];\n bitbybit.advanced.navigation.zoomOn(zoomOnOptions);\n};\n\nstart();","version":"0.21.0","type":"typescript"}} title="Star ornament with hanging hole" /> diff --git a/docs/learn/code/common/occt/modeling/festive-decor/gem-star.md b/docs/learn/code/common/occt/modeling/festive-decor/gem-star.md new file mode 100644 index 00000000..6a757971 --- /dev/null +++ b/docs/learn/code/common/occt/modeling/festive-decor/gem-star.md @@ -0,0 +1,83 @@ +--- +sidebar_position: 2 +title: Gem Star +sidebar_label: Gem Star +description: Create a simple 3D printable gem star decoration using polygon wire loft. +tags: [code, occt, rete, blockly, typescript] +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import BitByBitRenderCanvas from '@site/src/components/BitByBitRenderCanvas'; + +OCCT category icon with a stylized logo representation + +Create a gem-like star decoration by lofting a star-shaped wire profile to a single point, then mirroring it to form a complete solid. This technique produces a faceted ornament with clean geometric edges perfect for 3D printing. + + + + + + +raysouterRadiusinnerRadiusDivisorheightinnerRadiusstarWiretopPointloftShapemirroredShapeshapeListsewnShellsolidShapedrawnMesh'city'10000.10.7TRUErays5outerRadius4.5innerRadiusDivisor3.2height0.7innerRadiusDIVIDEouterRadiusinnerRadiusDivisorstarWire000010raysouterRadiusinnerRadiusFALSEtopPoint0height0loftShapestarWiretopPointFALSEFALSEFALSEFALSE10FALSE31e-7approxCentripetalmirroredShapeloftShape000010shapeListloftShapemirroredShapesewnShellshapeList1e-7solidShapesewnShelldrawnMeshsolidShape0.01Custom Material#4dffb2#0000000.80.31FALSE2TRUE#ffffff2drawnMeshTRUE0.8-0.3TRUE","version":"0.21.0","type":"blockly"}} +title="Gem star decoration" +/> + + + {\n const skyboxOpt = new SkyboxDto();\n skyboxOpt.skybox = skyboxEnum.city;\n skyboxOpt.hideSkybox = true;\n bitbybit.babylon.scene.enableSkybox(skyboxOpt);\n\n // 1. Variables\n const rays = 5;\n const outerRadius = 4.5;\n const innerRadiusDivisor = 3.2;\n const height = 0.7;\n const innerRadius = outerRadius / innerRadiusDivisor;\n\n // 2. Create Star Wire\n const starDto = new StarDto();\n starDto.center = [0, 0, 0];\n starDto.direction = [0, 1, 0];\n starDto.numRays = rays;\n starDto.outerRadius = outerRadius;\n starDto.innerRadius = innerRadius;\n starDto.half = false;\n const starWire = await wire.createStarWire(starDto);\n\n // 3. Loft to Top Point\n const loftDto = new LoftAdvancedDto();\n loftDto.shapes = [starWire];\n loftDto.startVertex = [0, height, 0];\n loftDto.makeSolid = false;\n loftDto.closed = false;\n loftDto.periodic = false;\n loftDto.straight = false;\n loftDto.nrPeriodicSections = 10;\n loftDto.useSmoothing = false;\n loftDto.maxUDegree = 3;\n loftDto.tolerance = 1e-7;\n loftDto.parType = approxParametrizationTypeEnum.approxCentripetal;\n const loftShape = await operations.loftAdvanced(loftDto);\n\n // 4. Mirror to create bottom half\n const mirrorDto = new MirrorAlongNormalDto();\n mirrorDto.shape = loftShape;\n mirrorDto.origin = [0, 0, 0];\n mirrorDto.normal = [0, 1, 0];\n const mirroredShape = await transforms.mirrorAlongNormal(mirrorDto);\n\n // 5. Sew Faces into a Shell\n const sewDto = new SewDto();\n sewDto.shapes = [loftShape, mirroredShape];\n sewDto.tolerance = 1e-7;\n const sewnShell = await shell.sewFaces(sewDto);\n\n // 6. Create Solid from Shell\n const solidDto = new ShapeDto();\n solidDto.shape = sewnShell;\n const solidShape = await solid.fromClosedShell(solidDto);\n\n // 7. Visualization\n const materialOptions = new PBRMetallicRoughnessDto();\n materialOptions.name = 'Custom Material';\n materialOptions.baseColor = '#4dffb2';\n materialOptions.emissiveColor = '#000000';\n materialOptions.metallic = 0.8;\n materialOptions.roughness = 0.3;\n materialOptions.alpha = 1;\n materialOptions.backFaceCulling = false;\n materialOptions.zOffset = 2;\n const material = bitbybit.babylon.material.pbrMetallicRoughness.create(materialOptions);\n\n const drawOptions = new DrawOcctShapeOptions();\n drawOptions.precision = 0.01;\n drawOptions.drawEdges = true;\n drawOptions.edgeColour = '#ffffff';\n drawOptions.edgeWidth = 2;\n drawOptions.faceMaterial = material;\n\n const drawnMesh = await bitbybit.draw.drawAnyAsync({\n entity: solidShape,\n options: drawOptions,\n });\n\n const zoomDto = new ZoomOnDto();\n zoomDto.meshes = [drawnMesh];\n zoomDto.includeChildren = true;\n zoomDto.animationSpeed = 0.8;\n zoomDto.offset = -0.3;\n zoomDto.doNotUpdateMaxZ = true;\n bitbybit.advanced.navigation.zoomOn(zoomDto);\n};\n\nstart();","version":"0.21.0","type":"typescript"}} +title="Gem star decoration" +/> + + + +## How It Works + +This tutorial demonstrates the classic technique of creating a double-sided gem or jewel shape. We start with a star-shaped wire at the base and loft it upward to converge at a single point, forming a pyramid-like top half. The lofting operation creates smooth triangular faces that connect each edge of the star to the apex point, giving the ornament its characteristic faceted appearance. + +To complete the gem, we mirror the top half along the horizontal plane to create an identical bottom half. These two halves are then sewn together into a closed shell and converted into a solid 3D object. The result is a symmetrical star gem with sharp faceted edges that catch light beautifully when rendered with metallic materials. + +## Algorithm Steps + +``` +1. Define parameters: + - Number of star rays + - Outer radius and inner radius + - Height of the apex point + +2. Create star wire: + - Generate star-shaped polygon at origin + - Star lies flat on XZ plane + +3. Loft to apex point: + - Start from star wire base + - Connect all edges to single point at height + - Creates pyramid/cone-like top half + +4. Mirror geometry: + - Reflect top half along Y=0 plane + - Creates matching bottom half + +5. Sew surfaces: + - Join top and bottom halves at star perimeter + - Forms closed watertight shell + +6. Convert to solid: + - Transform closed shell into solid body + - Ready for 3D printing or further operations + +7. Render with metallic material and edge highlighting +``` + +Adjust the number of rays, radius ratio, and height to create stars ranging from delicate ornaments to bold geometric decorations. \ No newline at end of file diff --git a/docs/learn/code/common/occt/modeling/festive-decor/star-ornament.md b/docs/learn/code/common/occt/modeling/festive-decor/star-ornament.md index 9d904508..f16e89c0 100644 --- a/docs/learn/code/common/occt/modeling/festive-decor/star-ornament.md +++ b/docs/learn/code/common/occt/modeling/festive-decor/star-ornament.md @@ -28,21 +28,21 @@ Our star begins as a simple 2D wire created using the `createStarWire` function. 552000010FALSE0.3TRUE0100.150.001TRUE#0000001Star Material#ffffff#00ffcc0.80.991FALSE2","version":"0.20.14","type":"blockly"}} + script={{"script":"552000010FALSE0.3TRUE0100.150.001TRUE#0000001Star Material#ffffff#00ffcc0.80.991FALSE2","version":"0.21.0","type":"blockly"}} title="Star ornament" /> {\n // Create PBR material with emissive glow\n const materialOptions = new PBRMetallicRoughnessDto();\n materialOptions.name = \"Star Material\";\n materialOptions.baseColor = \"#ffffff\";\n materialOptions.emissiveColor = \"#00ffcc\";\n materialOptions.metallic = 0.8;\n materialOptions.roughness = 0.99;\n materialOptions.alpha = 1;\n materialOptions.backFaceCulling = false;\n materialOptions.zOffset = 2;\n const material = bitbybit.babylon.material.pbrMetallicRoughness.create(materialOptions);\n\n // Create the star wire with 5 points\n const starOptions = new StarDto();\n starOptions.numRays = 5;\n starOptions.outerRadius = 5;\n starOptions.innerRadius = 2;\n starOptions.center = [0, 0, 0];\n starOptions.direction = [0, 1, 0];\n starOptions.half = false;\n const starWire = await wire.createStarWire(starOptions);\n\n // Apply 2D fillet to round the star's corners\n const fillet2dOptions = new FilletDto();\n fillet2dOptions.shape = starWire;\n fillet2dOptions.radius = 0.3;\n const filletedWire = await fillets.fillet2d(fillet2dOptions);\n\n // Create a face from the filleted wire\n const faceOptions = new FaceFromWireDto();\n faceOptions.shape = filletedWire;\n faceOptions.planar = true;\n const starFace = await face.createFaceFromWire(faceOptions);\n\n // Extrude the face to create a 3D solid\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = starFace;\n extrudeOptions.direction = [0, 1, 0];\n const starSolid = await operations.extrude(extrudeOptions);\n\n // Apply 3D fillet to smooth all edges\n const fillet3dOptions = new FilletDto();\n fillet3dOptions.shape = starSolid;\n fillet3dOptions.radius = 0.15;\n const finalStar = await fillets.filletEdges(fillet3dOptions);\n\n // Draw with custom material and edge styling\n const drawOptions = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n drawOptions.precision = 0.001;\n drawOptions.drawEdges = true;\n drawOptions.edgeColour = \"#000000\";\n drawOptions.edgeWidth = 1;\n drawOptions.faceMaterial = material;\n\n bitbybit.draw.drawAnyAsync({\n entity: finalStar,\n options: drawOptions\n });\n}\n\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const { StarDto, FilletDto, FaceFromWireDto, ExtrudeDto } = Bit.Inputs.OCCT;\nconst { PBRMetallicRoughnessDto } = Bit.Inputs.BabylonMaterial;\n\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSSolidPointer = Bit.Inputs.OCCT.TopoDSSolidPointer;\n\nconst { wire, face } = bitbybit.occt.shapes;\nconst { fillets, operations } = bitbybit.occt;\n\nconst start = async () => {\n // Create PBR material with emissive glow\n const materialOptions = new PBRMetallicRoughnessDto();\n materialOptions.name = \"Star Material\";\n materialOptions.baseColor = \"#ffffff\";\n materialOptions.emissiveColor = \"#00ffcc\";\n materialOptions.metallic = 0.8;\n materialOptions.roughness = 0.99;\n materialOptions.alpha = 1;\n materialOptions.backFaceCulling = false;\n materialOptions.zOffset = 2;\n const material = bitbybit.babylon.material.pbrMetallicRoughness.create(materialOptions);\n\n // Create the star wire with 5 points\n const starOptions = new StarDto();\n starOptions.numRays = 5;\n starOptions.outerRadius = 5;\n starOptions.innerRadius = 2;\n starOptions.center = [0, 0, 0];\n starOptions.direction = [0, 1, 0];\n starOptions.half = false;\n const starWire = await wire.createStarWire(starOptions);\n\n // Apply 2D fillet to round the star's corners\n const fillet2dOptions = new FilletDto();\n fillet2dOptions.shape = starWire;\n fillet2dOptions.radius = 0.3;\n const filletedWire = await fillets.fillet2d(fillet2dOptions);\n\n // Create a face from the filleted wire\n const faceOptions = new FaceFromWireDto();\n faceOptions.shape = filletedWire;\n faceOptions.planar = true;\n const starFace = await face.createFaceFromWire(faceOptions);\n\n // Extrude the face to create a 3D solid\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = starFace;\n extrudeOptions.direction = [0, 1, 0];\n const starSolid = await operations.extrude(extrudeOptions);\n\n // Apply 3D fillet to smooth all edges\n const fillet3dOptions = new FilletDto();\n fillet3dOptions.shape = starSolid;\n fillet3dOptions.radius = 0.15;\n const finalStar = await fillets.filletEdges(fillet3dOptions);\n\n // Draw with custom material and edge styling\n const drawOptions = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n drawOptions.precision = 0.001;\n drawOptions.drawEdges = true;\n drawOptions.edgeColour = \"#000000\";\n drawOptions.edgeWidth = 1;\n drawOptions.faceMaterial = material;\n\n bitbybit.draw.drawAnyAsync({\n entity: finalStar,\n options: drawOptions\n });\n}\n\nstart();","version":"0.21.0","type":"typescript"}} title="Star ornament" /> @@ -75,21 +75,21 @@ The cylinder is positioned at the top of the star (at the outer radius on the Z- outerRadiusouterRadius5.10000105outerRadiusDIVIDEouterRadius3FALSE0.3TRUE010DIVIDEouterRadius2000100.220.150.001Star Material#ffffff#00ffcc0.80.991FALSE2TRUE#0000001","version":"0.20.14","type":"blockly"}} + script={{"script":"outerRadiusouterRadius5.10000105outerRadiusDIVIDEouterRadius3FALSE0.3TRUE010DIVIDEouterRadius2000100.220.150.001Star Material#ffffff#00ffcc0.80.991FALSE2TRUE#0000001","version":"0.21.0","type":"blockly"}} title="Star ornament with hanging hole" /> {\n // Define outer radius as a variable (like the slider in Rete)\n const outerRadius = 5.1;\n const innerRadius = outerRadius / 3;\n\n // Create PBR material with emissive glow\n const materialOptions = new PBRMetallicRoughnessDto();\n materialOptions.name = \"Star Material\";\n materialOptions.baseColor = \"#ffffff\";\n materialOptions.emissiveColor = \"#00ffcc\";\n materialOptions.metallic = 0.8;\n materialOptions.roughness = 0.99;\n materialOptions.alpha = 1;\n materialOptions.backFaceCulling = false;\n materialOptions.zOffset = 2;\n const material = bitbybit.babylon.material.pbrMetallicRoughness.create(materialOptions);\n\n // Create the star wire with 5 points\n const starOptions = new StarDto();\n starOptions.numRays = 5;\n starOptions.outerRadius = outerRadius;\n starOptions.innerRadius = innerRadius;\n starOptions.center = [0, 0, 0];\n starOptions.direction = [0, 1, 0];\n starOptions.half = false;\n const starWire = await wire.createStarWire(starOptions);\n\n // Apply 2D fillet to round the star's corners\n const fillet2dOptions = new FilletDto();\n fillet2dOptions.shape = starWire;\n fillet2dOptions.radius = 0.3;\n const filletedWire = await fillets.fillet2d(fillet2dOptions);\n\n // Create a face from the filleted wire\n const faceOptions = new FaceFromWireDto();\n faceOptions.shape = filletedWire;\n faceOptions.planar = true;\n const starFace = await face.createFaceFromWire(faceOptions);\n\n // Extrude the face to create a 3D solid\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = starFace;\n extrudeOptions.direction = [0, 1, 0];\n const starSolid = await operations.extrude(extrudeOptions);\n\n // Create cylinder for the hanging hole\n const cylinderOptions = new CylinderDto();\n cylinderOptions.center = [outerRadius / 2, 0, 0]; // Position based on outer radius\n cylinderOptions.direction = [0, 1, 0];\n cylinderOptions.radius = 0.2;\n cylinderOptions.height = 2;\n const holeCylinder = await solid.createCylinder(cylinderOptions);\n\n // Boolean difference to cut the hole (before filleting edges)\n const diffOptions = new DifferenceDto();\n diffOptions.shape = starSolid;\n diffOptions.shapes = [holeCylinder];\n diffOptions.keepEdges = false;\n const starWithHole = await booleans.difference(diffOptions);\n\n // Apply 3D fillet to smooth all edges (after boolean)\n const fillet3dOptions = new FilletDto();\n fillet3dOptions.shape = starWithHole;\n fillet3dOptions.radius = 0.15;\n const finalStar = await fillets.filletEdges(fillet3dOptions);\n\n // Draw with custom material and edge styling\n const drawOptions = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n drawOptions.precision = 0.001;\n drawOptions.drawEdges = true;\n drawOptions.edgeColour = \"#000000\";\n drawOptions.edgeWidth = 1;\n drawOptions.faceMaterial = material;\n\n bitbybit.draw.drawAnyAsync({\n entity: finalStar,\n options: drawOptions\n });\n}\n\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const { StarDto, FilletDto, FaceFromWireDto, ExtrudeDto, CylinderDto, DifferenceDto } = Bit.Inputs.OCCT;\nconst { PBRMetallicRoughnessDto } = Bit.Inputs.BabylonMaterial;\n\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer;\n\nconst { wire, face, solid } = bitbybit.occt.shapes;\nconst { fillets, operations, booleans } = bitbybit.occt;\n\nconst start = async () => {\n // Define outer radius as a variable (like the slider in Rete)\n const outerRadius = 5.1;\n const innerRadius = outerRadius / 3;\n\n // Create PBR material with emissive glow\n const materialOptions = new PBRMetallicRoughnessDto();\n materialOptions.name = \"Star Material\";\n materialOptions.baseColor = \"#ffffff\";\n materialOptions.emissiveColor = \"#00ffcc\";\n materialOptions.metallic = 0.8;\n materialOptions.roughness = 0.99;\n materialOptions.alpha = 1;\n materialOptions.backFaceCulling = false;\n materialOptions.zOffset = 2;\n const material = bitbybit.babylon.material.pbrMetallicRoughness.create(materialOptions);\n\n // Create the star wire with 5 points\n const starOptions = new StarDto();\n starOptions.numRays = 5;\n starOptions.outerRadius = outerRadius;\n starOptions.innerRadius = innerRadius;\n starOptions.center = [0, 0, 0];\n starOptions.direction = [0, 1, 0];\n starOptions.half = false;\n const starWire = await wire.createStarWire(starOptions);\n\n // Apply 2D fillet to round the star's corners\n const fillet2dOptions = new FilletDto();\n fillet2dOptions.shape = starWire;\n fillet2dOptions.radius = 0.3;\n const filletedWire = await fillets.fillet2d(fillet2dOptions);\n\n // Create a face from the filleted wire\n const faceOptions = new FaceFromWireDto();\n faceOptions.shape = filletedWire;\n faceOptions.planar = true;\n const starFace = await face.createFaceFromWire(faceOptions);\n\n // Extrude the face to create a 3D solid\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = starFace;\n extrudeOptions.direction = [0, 1, 0];\n const starSolid = await operations.extrude(extrudeOptions);\n\n // Create cylinder for the hanging hole\n const cylinderOptions = new CylinderDto();\n cylinderOptions.center = [outerRadius / 2, 0, 0]; // Position based on outer radius\n cylinderOptions.direction = [0, 1, 0];\n cylinderOptions.radius = 0.2;\n cylinderOptions.height = 2;\n const holeCylinder = await solid.createCylinder(cylinderOptions);\n\n // Boolean difference to cut the hole (before filleting edges)\n const diffOptions = new DifferenceDto();\n diffOptions.shape = starSolid;\n diffOptions.shapes = [holeCylinder];\n diffOptions.keepEdges = false;\n const starWithHole = await booleans.difference(diffOptions);\n\n // Apply 3D fillet to smooth all edges (after boolean)\n const fillet3dOptions = new FilletDto();\n fillet3dOptions.shape = starWithHole;\n fillet3dOptions.radius = 0.15;\n const finalStar = await fillets.filletEdges(fillet3dOptions);\n\n // Draw with custom material and edge styling\n const drawOptions = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n drawOptions.precision = 0.001;\n drawOptions.drawEdges = true;\n drawOptions.edgeColour = \"#000000\";\n drawOptions.edgeWidth = 1;\n drawOptions.faceMaterial = material;\n\n bitbybit.draw.drawAnyAsync({\n entity: finalStar,\n options: drawOptions\n });\n}\n\nstart();","version":"0.21.0","type":"typescript"}} title="Star ornament with hanging hole" /> @@ -117,21 +117,21 @@ Now that we have our star ornament ready, let's export it as an STL file for 3D outerRadiusfinalStarouterRadius5.1finalStar0000105outerRadiusDIVIDEouterRadius3FALSE0.3TRUE010DIVIDEouterRadius2000100.220.15finalStar0.001Star Material#ffffff#00ffcc0.80.991FALSE2TRUE#0000001finalStarstar.stl0.001FALSETRUE","version":"0.20.14","type":"blockly"}} + script={{"script":"outerRadiusfinalStarouterRadius5.1finalStar0000105outerRadiusDIVIDEouterRadius3FALSE0.3TRUE010DIVIDEouterRadius2000100.220.15finalStar0.001Star Material#ffffff#00ffcc0.80.991FALSE2TRUE#0000001finalStarstar.stl0.001FALSETRUE","version":"0.21.0","type":"blockly"}} title="Star ornament with STL export" /> {\n // Define outer radius as a variable (like the slider in Rete)\n const outerRadius = 5.1;\n const innerRadius = outerRadius / 3;\n\n // Create PBR material with emissive glow\n const materialOptions = new PBRMetallicRoughnessDto();\n materialOptions.name = \"Star Material\";\n materialOptions.baseColor = \"#ffffff\";\n materialOptions.emissiveColor = \"#00ffcc\";\n materialOptions.metallic = 0.8;\n materialOptions.roughness = 0.99;\n materialOptions.alpha = 1;\n materialOptions.backFaceCulling = false;\n materialOptions.zOffset = 2;\n const material = bitbybit.babylon.material.pbrMetallicRoughness.create(materialOptions);\n\n // Create the star wire with 5 points\n const starOptions = new StarDto();\n starOptions.numRays = 5;\n starOptions.outerRadius = outerRadius;\n starOptions.innerRadius = innerRadius;\n starOptions.center = [0, 0, 0];\n starOptions.direction = [0, 1, 0];\n starOptions.half = false;\n const starWire = await wire.createStarWire(starOptions);\n\n // Apply 2D fillet to round the star's corners\n const fillet2dOptions = new FilletDto();\n fillet2dOptions.shape = starWire;\n fillet2dOptions.radius = 0.3;\n const filletedWire = await fillets.fillet2d(fillet2dOptions);\n\n // Create a face from the filleted wire\n const faceOptions = new FaceFromWireDto();\n faceOptions.shape = filletedWire;\n faceOptions.planar = true;\n const starFace = await face.createFaceFromWire(faceOptions);\n\n // Extrude the face to create a 3D solid\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = starFace;\n extrudeOptions.direction = [0, 1, 0];\n const starSolid = await operations.extrude(extrudeOptions);\n\n // Create cylinder for the hanging hole\n const cylinderOptions = new CylinderDto();\n cylinderOptions.center = [outerRadius / 2, 0, 0]; // Position based on outer radius\n cylinderOptions.direction = [0, 1, 0];\n cylinderOptions.radius = 0.2;\n cylinderOptions.height = 2;\n const holeCylinder = await solid.createCylinder(cylinderOptions);\n\n // Boolean difference to cut the hole (before filleting edges)\n const diffOptions = new DifferenceDto();\n diffOptions.shape = starSolid;\n diffOptions.shapes = [holeCylinder];\n diffOptions.keepEdges = false;\n const starWithHole = await booleans.difference(diffOptions);\n\n // Apply 3D fillet to smooth all edges (after boolean)\n const fillet3dOptions = new FilletDto();\n fillet3dOptions.shape = starWithHole;\n fillet3dOptions.radius = 0.15;\n const finalStar = await fillets.filletEdges(fillet3dOptions);\n\n // Draw with custom material and edge styling\n const drawOptions = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n drawOptions.precision = 0.001;\n drawOptions.drawEdges = true;\n drawOptions.edgeColour = \"#000000\";\n drawOptions.edgeWidth = 1;\n drawOptions.faceMaterial = material;\n\n bitbybit.draw.drawAnyAsync({\n entity: finalStar,\n options: drawOptions\n });\n\n // Export to STL for 3D printing\n const stlOptions = new SaveStlDto();\n stlOptions.shape = finalStar;\n stlOptions.fileName = \"star.stl\";\n stlOptions.precision = 0.001;\n stlOptions.adjustYtoZ = false;\n stlOptions.tryDownload = true;\n stlOptions.binary = true;\n await io.saveShapeStl(stlOptions);\n}\n\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const { StarDto, FilletDto, FaceFromWireDto, ExtrudeDto, CylinderDto, DifferenceDto } = Bit.Inputs.OCCT;\nconst { PBRMetallicRoughnessDto } = Bit.Inputs.BabylonMaterial;\nconst { SaveStlDto } = Bit.Inputs.OCCT;\n\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer;\n\nconst { wire, face, solid } = bitbybit.occt.shapes;\nconst { fillets, operations, booleans, io } = bitbybit.occt;\n\nconst start = async () => {\n // Define outer radius as a variable (like the slider in Rete)\n const outerRadius = 5.1;\n const innerRadius = outerRadius / 3;\n\n // Create PBR material with emissive glow\n const materialOptions = new PBRMetallicRoughnessDto();\n materialOptions.name = \"Star Material\";\n materialOptions.baseColor = \"#ffffff\";\n materialOptions.emissiveColor = \"#00ffcc\";\n materialOptions.metallic = 0.8;\n materialOptions.roughness = 0.99;\n materialOptions.alpha = 1;\n materialOptions.backFaceCulling = false;\n materialOptions.zOffset = 2;\n const material = bitbybit.babylon.material.pbrMetallicRoughness.create(materialOptions);\n\n // Create the star wire with 5 points\n const starOptions = new StarDto();\n starOptions.numRays = 5;\n starOptions.outerRadius = outerRadius;\n starOptions.innerRadius = innerRadius;\n starOptions.center = [0, 0, 0];\n starOptions.direction = [0, 1, 0];\n starOptions.half = false;\n const starWire = await wire.createStarWire(starOptions);\n\n // Apply 2D fillet to round the star's corners\n const fillet2dOptions = new FilletDto();\n fillet2dOptions.shape = starWire;\n fillet2dOptions.radius = 0.3;\n const filletedWire = await fillets.fillet2d(fillet2dOptions);\n\n // Create a face from the filleted wire\n const faceOptions = new FaceFromWireDto();\n faceOptions.shape = filletedWire;\n faceOptions.planar = true;\n const starFace = await face.createFaceFromWire(faceOptions);\n\n // Extrude the face to create a 3D solid\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = starFace;\n extrudeOptions.direction = [0, 1, 0];\n const starSolid = await operations.extrude(extrudeOptions);\n\n // Create cylinder for the hanging hole\n const cylinderOptions = new CylinderDto();\n cylinderOptions.center = [outerRadius / 2, 0, 0]; // Position based on outer radius\n cylinderOptions.direction = [0, 1, 0];\n cylinderOptions.radius = 0.2;\n cylinderOptions.height = 2;\n const holeCylinder = await solid.createCylinder(cylinderOptions);\n\n // Boolean difference to cut the hole (before filleting edges)\n const diffOptions = new DifferenceDto();\n diffOptions.shape = starSolid;\n diffOptions.shapes = [holeCylinder];\n diffOptions.keepEdges = false;\n const starWithHole = await booleans.difference(diffOptions);\n\n // Apply 3D fillet to smooth all edges (after boolean)\n const fillet3dOptions = new FilletDto();\n fillet3dOptions.shape = starWithHole;\n fillet3dOptions.radius = 0.15;\n const finalStar = await fillets.filletEdges(fillet3dOptions);\n\n // Draw with custom material and edge styling\n const drawOptions = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n drawOptions.precision = 0.001;\n drawOptions.drawEdges = true;\n drawOptions.edgeColour = \"#000000\";\n drawOptions.edgeWidth = 1;\n drawOptions.faceMaterial = material;\n\n bitbybit.draw.drawAnyAsync({\n entity: finalStar,\n options: drawOptions\n });\n\n // Export to STL for 3D printing\n const stlOptions = new SaveStlDto();\n stlOptions.shape = finalStar;\n stlOptions.fileName = \"star.stl\";\n stlOptions.precision = 0.001;\n stlOptions.adjustYtoZ = false;\n stlOptions.tryDownload = true;\n stlOptions.binary = true;\n await io.saveShapeStl(stlOptions);\n}\n\nstart();","version":"0.21.0","type":"typescript"}} title="Star ornament with STL export" /> diff --git a/docs/learn/code/common/occt/modeling/festive-decor/tree-decoration.md b/docs/learn/code/common/occt/modeling/festive-decor/tree-decoration.md index 62a9eb27..63d178a0 100644 --- a/docs/learn/code/common/occt/modeling/festive-decor/tree-decoration.md +++ b/docs/learn/code/common/occt/modeling/festive-decor/tree-decoration.md @@ -1,5 +1,5 @@ --- -sidebar_position: 5 +sidebar_position: 6 title: Tree Decoration sidebar_label: Tree Decoration description: Create a 3D printable Christmas tree decoration. @@ -81,7 +81,7 @@ All controls use observable listeners to trigger geometry regeneration when valu {\\n // ADD YOUR CODE HERE\\n if (inputs === true) {\\n window.open(\\\"https://bitbybit.dev/app/bitbybit/KtIymkYFZ8Qty9h8mhew/Y7NQIgaXLy0dqffnc825?editor=rete\\\", '_blank').focus();\\n }\\n return inputs;\\n}\"}},\"inputs\":{\"inputs\":{\"connections\":[{\"node\":\"fbe1705ff510913a\",\"output\":\"isA\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"fbe1705ff510913a\",\"output\":\"execA\",\"data\":{}},{\"node\":\"fbe1705ff510913a\",\"output\":\"execB\",\"data\":{}}]}},\"position\":[1749.7763306366996,10636.786904135595]},\"af7350efdb0b85b3\":{\"id\":\"af7350efdb0b85b3\",\"name\":\"bitbybit.babylon.gui.control.createControlObservableSelector\",\"customName\":\"control observable selector\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"selector\":\"onPointerUpObservable\"},\"inputs\":{},\"position\":[686.4715121547069,8508.681235887017]},\"f2e18ffd18566787\":{\"id\":\"f2e18ffd18566787\",\"name\":\"bitbybit.flow.babylon.observableListener\",\"customName\":\"babylon observable listener\",\"data\":{},\"inputs\":{\"object\":{\"connections\":[{\"node\":\"22b0aaced3db29ad\",\"output\":\"result\",\"data\":{}}]},\"observableSelector\":{\"connections\":[{\"node\":\"af7350efdb0b85b3\",\"output\":\"result\",\"data\":{}}]}},\"position\":[1453.070365919411,8258.538315404885]},\"70259fc69f3db105\":{\"id\":\"70259fc69f3db105\",\"name\":\"bitbybit.flow.time.delay\",\"customName\":\"delay\",\"data\":{\"timeout\":0},\"inputs\":{\"exec\":{\"connections\":[{\"node\":\"f2e18ffd18566787\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[1987.6045976314351,8437.042718662588]},\"291c95f88aae5725\":{\"id\":\"291c95f88aae5725\",\"name\":\"bitbybit.flow.logic.flipFlop\",\"customName\":\"flip flop\",\"data\":{},\"inputs\":{\"exec\":{\"connections\":[{\"node\":\"70259fc69f3db105\",\"output\":\"exec\",\"data\":{}},{\"node\":\"f2e18ffd18566787\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[2323.4070267726706,8288.053843144928]},\"ac5f02670de06852\":{\"id\":\"ac5f02670de06852\",\"name\":\"bitbybit.code.typeScriptEditor\",\"customName\":\"typescript editor\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":true},\"code\":{\"code\":\"// DO NOT REMOVE THIS FUNCTION\\nconst startac5f02670de06852 = async (inputs: any, index: number) => {\\n // ADD YOUR CODE HERE\\n if (inputs === true) {\\n window.open(\\\"https://bitbybit.dev/auth/sign-up\\\", '_blank').focus();\\n }\\n return inputs;\\n}\"}},\"inputs\":{\"inputs\":{\"connections\":[{\"node\":\"291c95f88aae5725\",\"output\":\"isA\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"291c95f88aae5725\",\"output\":\"execA\",\"data\":{}},{\"node\":\"291c95f88aae5725\",\"output\":\"execB\",\"data\":{}}]}},\"position\":[2681.990286952205,8287.587249893892]},\"b5af9279ffdd84e5\":{\"id\":\"b5af9279ffdd84e5\",\"name\":\"bitbybit.babylon.scene.enableSkybox\",\"customName\":\"enable skybox\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"skybox\":\"city\",\"size\":1000,\"blur\":0.5,\"environmentIntensity\":0.7,\"hideSkybox\":false},\"inputs\":{},\"position\":[2884.1306675480555,-186.0490873535386]},\"9dca219fedacecca\":{\"id\":\"9dca219fedacecca\",\"name\":\"bitbybit.flow.babylon.observableListener\",\"customName\":\"babylon observable listener\",\"data\":{},\"inputs\":{\"observableSelector\":{\"connections\":[{\"node\":\"f1f8cf3eadfa0ebb\",\"output\":\"result\",\"data\":{}}]},\"object\":{\"connections\":[{\"node\":\"71fbc1ccee37d577\",\"output\":\"result\",\"data\":{}}]}},\"position\":[385.9268891419183,10329.874563653837]},\"bb201b1ec9f17a1e\":{\"id\":\"bb201b1ec9f17a1e\",\"name\":\"bitbybit.flow.babylon.observableListener\",\"customName\":\"babylon observable listener\",\"data\":{},\"inputs\":{\"observableSelector\":{\"connections\":[{\"node\":\"f1f8cf3eadfa0ebb\",\"output\":\"result\",\"data\":{}}]},\"object\":{\"connections\":[{\"node\":\"fc36f702c3f8146e\",\"output\":\"result\",\"data\":{}}]}},\"position\":[394.16500271911553,10076.96114156523]},\"4a5d1c196a0b447e\":{\"id\":\"4a5d1c196a0b447e\",\"name\":\"bitbybit.flow.time.delay\",\"customName\":\"delay\",\"data\":{\"timeout\":0},\"inputs\":{\"exec\":{\"connections\":[{\"node\":\"9dca219fedacecca\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[936.4095297912264,10457.862715124222]},\"4fd171db189ad173\":{\"id\":\"4fd171db189ad173\",\"name\":\"bitbybit.flow.logic.flipFlop\",\"customName\":\"flip flop\",\"data\":{},\"inputs\":{\"exec\":{\"connections\":[{\"node\":\"9dca219fedacecca\",\"output\":\"exec\",\"data\":{}},{\"node\":\"4a5d1c196a0b447e\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[1273.654131279585,10355.281487174021]},\"94b6dd1354940df2\":{\"id\":\"94b6dd1354940df2\",\"name\":\"bitbybit.flow.time.delay\",\"customName\":\"delay\",\"data\":{\"timeout\":0},\"inputs\":{\"exec\":{\"connections\":[{\"node\":\"bb201b1ec9f17a1e\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[926.4956949832613,10212.522265939324]},\"27eac850201a9701\":{\"id\":\"27eac850201a9701\",\"name\":\"bitbybit.flow.logic.flipFlop\",\"customName\":\"flip flop\",\"data\":{},\"inputs\":{\"exec\":{\"connections\":[{\"node\":\"bb201b1ec9f17a1e\",\"output\":\"exec\",\"data\":{}},{\"node\":\"94b6dd1354940df2\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[1272.0778730255988,10103.055278248028]},\"9190095ec9cfd394\":{\"id\":\"9190095ec9cfd394\",\"name\":\"bitbybit.logic.valueGate\",\"customName\":\"value gate\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"boolean\":false},\"inputs\":{\"value\":{\"connections\":[{\"node\":\"73ee3cd6670755bb\",\"output\":\"result\",\"data\":{}}]},\"boolean\":{\"connections\":[{\"node\":\"27eac850201a9701\",\"output\":\"isA\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"27eac850201a9701\",\"output\":\"execA\",\"data\":{}},{\"node\":\"27eac850201a9701\",\"output\":\"execB\",\"data\":{}}]}},\"position\":[2098.7596218076405,9630.876889007699]},\"73ee3cd6670755bb\":{\"id\":\"73ee3cd6670755bb\",\"name\":\"bitbybit.text.create\",\"customName\":\"create\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"bitbybit-toy.step\"},\"inputs\":{},\"position\":[1701.8222304032442,9540.575618331815]},\"f9a87606405961ae\":{\"id\":\"f9a87606405961ae\",\"name\":\"bitbybit.text.create\",\"customName\":\"create\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"bitbybit-toy.stl\"},\"inputs\":{},\"position\":[1934.0481177357838,10057.705993169464]},\"f8db44954a566616\":{\"id\":\"f8db44954a566616\",\"name\":\"bitbybit.logic.valueGate\",\"customName\":\"value gate\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"boolean\":false},\"inputs\":{\"value\":{\"connections\":[{\"node\":\"f9a87606405961ae\",\"output\":\"result\",\"data\":{}}]},\"boolean\":{\"connections\":[{\"node\":\"4fd171db189ad173\",\"output\":\"isA\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"4fd171db189ad173\",\"output\":\"execA\",\"data\":{}},{\"node\":\"4fd171db189ad173\",\"output\":\"execB\",\"data\":{}}]}},\"position\":[2360.5651787274305,10179.991268481712]},\"7ae3f1f373ab7ce8\":{\"id\":\"7ae3f1f373ab7ce8\",\"name\":\"bitbybit.occt.io.saveShapeSTEPAndReturn\",\"customName\":\"save shape step and return\",\"async\":true,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"fileName\":\"\",\"adjustYtoZ\":true,\"fromRightHanded\":false,\"tryDownload\":true},\"inputs\":{\"shape\":{\"connections\":[{\"node\":\"ff3a5dfe26c1203f\",\"output\":\"result\",\"data\":{}}]},\"fileName\":{\"connections\":[{\"node\":\"9190095ec9cfd394\",\"output\":\"result\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"9190095ec9cfd394\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[4105.580503617983,9860.933809645778]},\"b358af77da1782cf\":{\"id\":\"b358af77da1782cf\",\"name\":\"bitbybit.occt.io.saveShapeStl\",\"customName\":\"save shape stl\",\"async\":true,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"fileName\":\"shape.stl\",\"precision\":0.01,\"adjustYtoZ\":true,\"tryDownload\":true,\"binary\":true},\"inputs\":{\"fileName\":{\"connections\":[{\"node\":\"f8db44954a566616\",\"output\":\"result\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"f8db44954a566616\",\"output\":\"exec\",\"data\":{}}]},\"shape\":{\"connections\":[{\"node\":\"ff3a5dfe26c1203f\",\"output\":\"result\",\"data\":{}}]}},\"position\":[4097.343815578738,10313.986149668373]},\"feef4ec0e40282e7\":{\"id\":\"feef4ec0e40282e7\",\"name\":\"bitbybit.math.number\",\"customName\":\"number\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"number\":0.5},\"inputs\":{},\"position\":[2389.4392361815517,2241.565476619029]},\"03303a3d3cb2a6b5\":{\"id\":\"03303a3d3cb2a6b5\",\"name\":\"bitbybit.json.parse\",\"customName\":\"parse\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"[true,false,true,true]\"},\"inputs\":{},\"position\":[2389.302212365796,2597.6283579746796]},\"f39c312f7e1e1bef\":{\"id\":\"f39c312f7e1e1bef\",\"name\":\"bitbybit.flow.babylon.observableListener\",\"customName\":\"babylon observable listener\",\"data\":{},\"inputs\":{\"observableSelector\":{\"connections\":[{\"node\":\"19dd5abb3a2ed30a\",\"output\":\"result\",\"data\":{}}]},\"object\":{\"connections\":[{\"node\":\"dda72ba4bc855075\",\"output\":\"result\",\"data\":{}}]}},\"position\":[634.3045048773648,6411.35023828563]},\"19dd5abb3a2ed30a\":{\"id\":\"19dd5abb3a2ed30a\",\"name\":\"bitbybit.babylon.gui.slider.createSliderObservableSelector\",\"customName\":\"slider observable selector\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"selector\":\"onValueChangedObservable\"},\"inputs\":{},\"position\":[119.33402358269528,6252.634270289916]},\"3f3e9efb919889cb\":{\"id\":\"3f3e9efb919889cb\",\"name\":\"bitbybit.flow.babylon.observableListener\",\"customName\":\"babylon observable listener\",\"data\":{},\"inputs\":{\"observableSelector\":{\"connections\":[{\"node\":\"19dd5abb3a2ed30a\",\"output\":\"result\",\"data\":{}}]},\"object\":{\"connections\":[{\"node\":\"eb164cb9f2c3d0b2\",\"output\":\"result\",\"data\":{}}]}},\"position\":[626.2393558517689,6035.026931379336]},\"b85e303f418ea094\":{\"id\":\"b85e303f418ea094\",\"name\":\"bitbybit.flow.babylon.getEventDataFromObservedResult\",\"customName\":\"get event data\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false}},\"inputs\":{\"json\":{\"connections\":[{\"node\":\"3f3e9efb919889cb\",\"output\":\"result\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"3f3e9efb919889cb\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[1213.8284182083087,6031.8004190176025]},\"0ae184887b347212\":{\"id\":\"0ae184887b347212\",\"name\":\"bitbybit.flow.babylon.getEventDataFromObservedResult\",\"customName\":\"get event data\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false}},\"inputs\":{\"exec\":{\"connections\":[{\"node\":\"f39c312f7e1e1bef\",\"output\":\"exec\",\"data\":{}}]},\"json\":{\"connections\":[{\"node\":\"f39c312f7e1e1bef\",\"output\":\"result\",\"data\":{}}]}},\"position\":[1212.113699374194,6401.279001431719]},\"ffecd6164df0c288\":{\"id\":\"ffecd6164df0c288\",\"name\":\"bitbybit.logic.firstDefinedValueGate\",\"customName\":\"first defined value gate\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false}},\"inputs\":{\"value1\":{\"connections\":[{\"node\":\"b85e303f418ea094\",\"output\":\"result\",\"data\":{}}]},\"value2\":{\"connections\":[{\"node\":\"6e51a85f13ab5259\",\"output\":\"result\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"b85e303f418ea094\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[1795.1547936226411,6012.662361553964]},\"d90e74b18631a7e7\":{\"id\":\"d90e74b18631a7e7\",\"name\":\"bitbybit.logic.firstDefinedValueGate\",\"customName\":\"first defined value gate\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false}},\"inputs\":{\"exec\":{\"connections\":[{\"node\":\"0ae184887b347212\",\"output\":\"exec\",\"data\":{}}]},\"value2\":{\"connections\":[{\"node\":\"dc27ec58598933e4\",\"output\":\"result\",\"data\":{}}]},\"value1\":{\"connections\":[{\"node\":\"0ae184887b347212\",\"output\":\"result\",\"data\":{}}]}},\"position\":[1827.0393870782336,6490.834733956343]},\"9ed742a672a607ce\":{\"id\":\"9ed742a672a607ce\",\"name\":\"bitbybit.lists.createList\",\"customName\":\"create list\",\"data\":{},\"inputs\":{\"listElements\":{\"connections\":[{\"node\":\"ffecd6164df0c288\",\"output\":\"result\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"ffecd6164df0c288\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[2408.212815313349,6050.3207511429555]},\"48046af83dbc9299\":{\"id\":\"48046af83dbc9299\",\"name\":\"bitbybit.lists.createList\",\"customName\":\"create list\",\"data\":{},\"inputs\":{\"listElements\":{\"connections\":[{\"node\":\"d90e74b18631a7e7\",\"output\":\"result\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"d90e74b18631a7e7\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[2407.3069815807094,6523.841211518347]},\"46f99a9e9cfc9152\":{\"id\":\"46f99a9e9cfc9152\",\"name\":\"bitbybit.text.format\",\"customName\":\"format\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"Number Of Rays - {0}\",\"values\":[\"World\"]},\"inputs\":{\"values\":{\"connections\":[{\"node\":\"9ed742a672a607ce\",\"output\":\"list\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"9ed742a672a607ce\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[2774.3846965928947,5974.2361780617475]},\"ced830dd20fb5b02\":{\"id\":\"ced830dd20fb5b02\",\"name\":\"bitbybit.text.format\",\"customName\":\"format\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"Vertical Divsions - {0}\",\"values\":[\"World\"]},\"inputs\":{\"exec\":{\"connections\":[{\"node\":\"48046af83dbc9299\",\"output\":\"exec\",\"data\":{}}]},\"values\":{\"connections\":[{\"node\":\"48046af83dbc9299\",\"output\":\"list\",\"data\":{}}]}},\"position\":[2794.9763891153702,6450.397669292677]},\"af2cb4893a5bc1cb\":{\"id\":\"af2cb4893a5bc1cb\",\"name\":\"bitbybit.babylon.gui.textBlock.setText\",\"customName\":\"set text\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"\"},\"inputs\":{\"text\":{\"connections\":[{\"node\":\"46f99a9e9cfc9152\",\"output\":\"result\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"46f99a9e9cfc9152\",\"output\":\"exec\",\"data\":{}}]},\"textBlock\":{\"connections\":[{\"node\":\"f80263a3d6977ea4\",\"output\":\"result\",\"data\":{}}]}},\"position\":[3408.9286383465733,6175.853417797766]},\"bb5fa4b16d910cb5\":{\"id\":\"bb5fa4b16d910cb5\",\"name\":\"bitbybit.babylon.gui.textBlock.setText\",\"customName\":\"set text\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"\"},\"inputs\":{\"textBlock\":{\"connections\":[{\"node\":\"a3006cf7f5041ef6\",\"output\":\"result\",\"data\":{}}]},\"text\":{\"connections\":[{\"node\":\"ced830dd20fb5b02\",\"output\":\"result\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"ced830dd20fb5b02\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[3443.5303027369487,6538.552534619226]},\"8ecfa2d91d973882\":{\"id\":\"8ecfa2d91d973882\",\"name\":\"bitbybit.babylon.gui.control.createControlObservableSelector\",\"customName\":\"control observable selector\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"selector\":\"onPointerUpObservable\"},\"inputs\":{},\"position\":[112.53197228874697,7216.911800887681]},\"8478c18af95701d2\":{\"id\":\"8478c18af95701d2\",\"name\":\"bitbybit.flow.babylon.observableListener\",\"customName\":\"babylon observable listener\",\"data\":{},\"inputs\":{\"observableSelector\":{\"connections\":[{\"node\":\"8ecfa2d91d973882\",\"output\":\"result\",\"data\":{}}]},\"object\":{\"connections\":[{\"node\":\"dda72ba4bc855075\",\"output\":\"result\",\"data\":{}}]}},\"position\":[666.0061734678349,7042.204203322666]},\"fa5a486b0621317a\":{\"id\":\"fa5a486b0621317a\",\"name\":\"bitbybit.flow.babylon.observableListener\",\"customName\":\"babylon observable listener\",\"data\":{},\"inputs\":{\"observableSelector\":{\"connections\":[{\"node\":\"8ecfa2d91d973882\",\"output\":\"result\",\"data\":{}}]},\"object\":{\"connections\":[{\"node\":\"eb164cb9f2c3d0b2\",\"output\":\"result\",\"data\":{}}]}},\"position\":[667.4427756519425,6826.609623951564]},\"7299a501c8e860c5\":{\"id\":\"7299a501c8e860c5\",\"name\":\"bitbybit.lists.passThrough\",\"customName\":\"pass through\",\"data\":{},\"inputs\":{\"exec\":{\"connections\":[{\"node\":\"fa5a486b0621317a\",\"output\":\"exec\",\"data\":{}},{\"node\":\"8478c18af95701d2\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[6778.4019145441225,6945.999036012015]},\"68fc3da5a920f715\":{\"id\":\"68fc3da5a920f715\",\"name\":\"bitbybit.babylon.scene.adjustActiveArcRotateCamera\",\"customName\":\"adjust active arc rotate camera\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"position\":[10,10,10],\"lookAt\":[0,0,0],\"lowerBetaLimit\":1,\"upperBetaLimit\":179,\"angularSensibilityX\":1000,\"angularSensibilityY\":1000,\"maxZ\":1000,\"panningSensibility\":1000,\"wheelPrecision\":3},\"inputs\":{\"position\":{\"connections\":[{\"node\":\"2c23a73974610198\",\"output\":\"result\",\"data\":{}}]},\"lookAt\":{\"connections\":[{\"node\":\"4b908f56b3ed505c\",\"output\":\"result\",\"data\":{}}]}},\"position\":[2457.6836534900826,-2687.8751308577216]},\"2c23a73974610198\":{\"id\":\"2c23a73974610198\",\"name\":\"bitbybit.vector.vectorXYZ\",\"customName\":\"vector xyz\",\"async\":false,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"x\":30,\"y\":25,\"z\":0},\"inputs\":{},\"position\":[2028.1960653764377,-2763.197379436671]},\"4b908f56b3ed505c\":{\"id\":\"4b908f56b3ed505c\",\"name\":\"bitbybit.vector.vectorXYZ\",\"customName\":\"vector xyz\",\"async\":false,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"x\":0,\"y\":4,\"z\":0},\"inputs\":{},\"position\":[2033.62438677469,-2317.355175655833]}}}","version":"0.20.12","type":"rete"}} + script={{"script":"{\"id\":\"rete-v2-json\",\"nodes\":{\"4534540d6856552d\":{\"id\":\"4534540d6856552d\",\"name\":\"bitbybit.occt.shapes.wire.createStarWire\",\"customName\":\"star wire\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"center\":[0,0,0],\"direction\":[0,1,0],\"numRays\":12,\"outerRadius\":20,\"innerRadius\":12,\"offsetOuterEdges\":0,\"half\":false},\"inputs\":{\"numRays\":{\"connections\":[{\"node\":\"ffecd6164df0c288\",\"output\":\"result\",\"data\":{}}]}},\"position\":[29.498322548778063,508.0780203076317]},\"b983a207fda22099\":{\"id\":\"b983a207fda22099\",\"name\":\"bitbybit.occt.transforms.translate\",\"customName\":\"translate\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"translation\":[0,0,0]},\"inputs\":{\"translation\":{\"connections\":[{\"node\":\"76bf07ac6376dd9d\",\"output\":\"result\",\"data\":{}}]},\"shape\":{\"connections\":[{\"node\":\"892079e9447f3eae\",\"output\":\"result\",\"data\":{}}]}},\"position\":[1421.0202335352003,1035.739426279123]},\"76bf07ac6376dd9d\":{\"id\":\"76bf07ac6376dd9d\",\"name\":\"bitbybit.vector.vectorXYZ\",\"customName\":\"vector xyz\",\"async\":false,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"x\":0,\"y\":20,\"z\":0},\"inputs\":{},\"position\":[4.113044262054515,1088.1382664289113]},\"892079e9447f3eae\":{\"id\":\"892079e9447f3eae\",\"name\":\"bitbybit.occt.transforms.scale\",\"customName\":\"scale\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"factor\":0.15},\"inputs\":{\"shape\":{\"connections\":[{\"node\":\"4534540d6856552d\",\"output\":\"result\",\"data\":{}}]}},\"position\":[1039.174244697755,869.9580356533191]},\"11549f1b45ea9b19\":{\"id\":\"11549f1b45ea9b19\",\"name\":\"bitbybit.occt.transforms.translate\",\"customName\":\"translate\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"translation\":[0,0,0]},\"inputs\":{\"translation\":{\"connections\":[{\"node\":\"ed8b1944898e2ce1\",\"output\":\"result\",\"data\":{}}]},\"shape\":{\"connections\":[{\"node\":\"cb6929579b17268b\",\"output\":\"result\",\"data\":{}}]}},\"position\":[843.9071289289463,1724.0141995434674]},\"ed8b1944898e2ce1\":{\"id\":\"ed8b1944898e2ce1\",\"name\":\"bitbybit.vector.vectorXYZ\",\"customName\":\"vector xyz\",\"async\":false,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"x\":0,\"y\":-5,\"z\":0},\"inputs\":{},\"position\":[407.2814628248683,1768.0222128529601]},\"c7bdc15abbc2ba7d\":{\"id\":\"c7bdc15abbc2ba7d\",\"name\":\"bitbybit.occt.operations.loft\",\"customName\":\"loft\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"makeSolid\":false},\"inputs\":{\"shapes\":{\"connections\":[{\"node\":\"875673f0ab1bb510\",\"output\":\"list\",\"data\":{}}]}},\"position\":[2071.471395598051,848.4908460058068]},\"875673f0ab1bb510\":{\"id\":\"875673f0ab1bb510\",\"name\":\"bitbybit.lists.createList\",\"customName\":\"create list\",\"data\":{},\"inputs\":{\"listElements\":{\"connections\":[{\"node\":\"47f69e3aabe06071\",\"output\":\"result\",\"data\":{}},{\"node\":\"b983a207fda22099\",\"output\":\"result\",\"data\":{}},{\"node\":\"4534540d6856552d\",\"output\":\"result\",\"data\":{}}]}},\"position\":[1782.785359527408,889.106870548469]},\"47f69e3aabe06071\":{\"id\":\"47f69e3aabe06071\",\"name\":\"bitbybit.occt.transforms.translate\",\"customName\":\"translate\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"translation\":[0,0,0]},\"inputs\":{\"translation\":{\"connections\":[{\"node\":\"a15b2d55874ba400\",\"output\":\"result\",\"data\":{}}]},\"shape\":{\"connections\":[{\"node\":\"f360184ff5aba2df\",\"output\":\"result\",\"data\":{}}]}},\"position\":[1245.2288399130869,247.04605010960086]},\"f360184ff5aba2df\":{\"id\":\"f360184ff5aba2df\",\"name\":\"bitbybit.occt.transforms.scale\",\"customName\":\"scale\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"factor\":0.25},\"inputs\":{\"shape\":{\"connections\":[{\"node\":\"4534540d6856552d\",\"output\":\"result\",\"data\":{}}]}},\"position\":[793.2018829015179,318.06376415603927]},\"a15b2d55874ba400\":{\"id\":\"a15b2d55874ba400\",\"name\":\"bitbybit.vector.vectorXYZ\",\"customName\":\"vector xyz\",\"async\":false,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"x\":0,\"y\":30,\"z\":0},\"inputs\":{},\"position\":[794.3690505014016,-54.119980109301466]},\"16e58d428c0abb1e\":{\"id\":\"16e58d428c0abb1e\",\"name\":\"bitbybit.babylon.scene.drawDirectionalLight\",\"customName\":\"draw directional light\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"direction\":[-100,-100,-100],\"intensity\":3,\"diffuse\":\"#ffffff\",\"specular\":\"#ffffff\",\"shadowGeneratorMapSize\":1024,\"enableShadows\":true,\"shadowDarkness\":0,\"shadowUsePercentageCloserFiltering\":true,\"shadowContactHardeningLightSizeUVRatio\":0.2,\"shadowBias\":0.0001,\"shadowNormalBias\":0.002,\"shadowMaxZ\":1000,\"shadowMinZ\":0},\"inputs\":{\"direction\":{\"connections\":[{\"node\":\"fa96ae89f95b4b18\",\"output\":\"result\",\"data\":{}}]}},\"position\":[2410.2001319497786,-1854.3247886875574]},\"cb6929579b17268b\":{\"id\":\"cb6929579b17268b\",\"name\":\"bitbybit.occt.transforms.scale\",\"customName\":\"scale\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"factor\":0.3},\"inputs\":{\"shape\":{\"connections\":[{\"node\":\"4534540d6856552d\",\"output\":\"result\",\"data\":{}}]}},\"position\":[457.0402990348086,1405.480031322518]},\"e9b4d2a7926e953f\":{\"id\":\"e9b4d2a7926e953f\",\"name\":\"bitbybit.occt.operations.loftAdvanced\",\"customName\":\"loft advanced\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"makeSolid\":false,\"closed\":false,\"periodic\":false,\"straight\":false,\"nrPeriodicSections\":10,\"useSmoothing\":false,\"maxUDegree\":3,\"tolerance\":1e-7,\"parType\":\"approxCentripetal\"},\"inputs\":{\"shapes\":{\"connections\":[{\"node\":\"570ca0cbda09cb78\",\"output\":\"list\",\"data\":{}}]},\"startVertex\":{\"connections\":[{\"node\":\"294942bd7a13ef3b\",\"output\":\"result\",\"data\":{}}]}},\"position\":[1793.6009797350105,1402.1120964226682]},\"570ca0cbda09cb78\":{\"id\":\"570ca0cbda09cb78\",\"name\":\"bitbybit.lists.createList\",\"customName\":\"create list\",\"data\":{},\"inputs\":{\"listElements\":{\"connections\":[{\"node\":\"11549f1b45ea9b19\",\"output\":\"result\",\"data\":{}},{\"node\":\"4534540d6856552d\",\"output\":\"result\",\"data\":{}}]}},\"position\":[1321.0103546184212,1396.929370018355]},\"294942bd7a13ef3b\":{\"id\":\"294942bd7a13ef3b\",\"name\":\"bitbybit.vector.vectorXYZ\",\"customName\":\"vector xyz\",\"async\":false,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"x\":0,\"y\":-10,\"z\":0},\"inputs\":{},\"position\":[1348.5723772315805,1760.5007306049315]},\"14ff0cda52cd7ce0\":{\"id\":\"14ff0cda52cd7ce0\",\"name\":\"bitbybit.occt.shapes.face.createFaceFromWire\",\"customName\":\"face from wire\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"planar\":true},\"inputs\":{\"shape\":{\"connections\":[{\"node\":\"47f69e3aabe06071\",\"output\":\"result\",\"data\":{}}]}},\"position\":[1836.8581524949377,110.6324723551911]},\"a153773318fd229a\":{\"id\":\"a153773318fd229a\",\"name\":\"bitbybit.lists.createList\",\"customName\":\"create list\",\"data\":{},\"inputs\":{\"listElements\":{\"connections\":[{\"node\":\"fda5ede008aae952\",\"output\":\"result\",\"data\":{}},{\"node\":\"e5331e883d23938e\",\"output\":\"result\",\"data\":{}},{\"node\":\"3bc9cf346fc8ef2a\",\"output\":\"result\",\"data\":{}},{\"node\":\"5a762f02bed474cd\",\"output\":\"result\",\"data\":{}},{\"node\":\"e9b4d2a7926e953f\",\"output\":\"result\",\"data\":{}},{\"node\":\"ed8dca56f5a8e402\",\"output\":\"result\",\"data\":{}},{\"node\":\"14ff0cda52cd7ce0\",\"output\":\"result\",\"data\":{}}]}},\"position\":[7499.583074067741,153.2312211535806]},\"ec6a4cb0d7105988\":{\"id\":\"ec6a4cb0d7105988\",\"name\":\"bitbybit.occt.shapes.shell.sewFaces\",\"customName\":\"sew faces\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"tolerance\":1e-7},\"inputs\":{\"shapes\":{\"connections\":[{\"node\":\"a153773318fd229a\",\"output\":\"list\",\"data\":{}}]}},\"position\":[7778.252945194093,116.96317643777269]},\"d533f9b2b358e932\":{\"id\":\"d533f9b2b358e932\",\"name\":\"bitbybit.occt.shapes.solid.fromClosedShell\",\"customName\":\"from closed shell\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false}},\"inputs\":{\"shape\":{\"connections\":[{\"node\":\"ec6a4cb0d7105988\",\"output\":\"result\",\"data\":{}}]}},\"position\":[8740.894126518644,641.4684856178552]},\"65118a904f1bcadd\":{\"id\":\"65118a904f1bcadd\",\"name\":\"bitbybit.draw.drawAnyAsync\",\"customName\":\"draw any async\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false}},\"inputs\":{\"options\":{\"connections\":[{\"node\":\"9d5759bf6abda9ea\",\"output\":\"result\",\"data\":{}}]},\"entity\":{\"connections\":[{\"node\":\"ff3a5dfe26c1203f\",\"output\":\"result\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"7299a501c8e860c5\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[10417.684603457687,1646.8416215802954]},\"9d5759bf6abda9ea\":{\"id\":\"9d5759bf6abda9ea\",\"name\":\"bitbybit.draw.optionsOcctShape\",\"customName\":\"options occt shape\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"faceOpacity\":1,\"edgeOpacity\":1,\"edgeColour\":\"#005e99\",\"faceColour\":\"#ffffff\",\"vertexColour\":\"#ff00ff\",\"edgeWidth\":1,\"vertexSize\":0.03,\"drawEdges\":true,\"drawFaces\":true,\"drawVertices\":false,\"precision\":0.005,\"drawEdgeIndexes\":false,\"edgeIndexHeight\":0.06,\"edgeIndexColour\":\"#ff00ff\",\"drawFaceIndexes\":false,\"faceIndexHeight\":0.06,\"faceIndexColour\":\"#0000ff\"},\"inputs\":{\"faceMaterial\":{\"connections\":[{\"node\":\"9cd68061ec4fd9e0\",\"output\":\"result\",\"data\":{}}]}},\"position\":[9991.876413478969,2364.565814067178]},\"825b687b6334e027\":{\"id\":\"825b687b6334e027\",\"name\":\"bitbybit.occt.shapes.face.getFaces\",\"customName\":\"get faces\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false}},\"inputs\":{\"shape\":{\"connections\":[{\"node\":\"c7bdc15abbc2ba7d\",\"output\":\"result\",\"data\":{}}]}},\"position\":[2383.6709076575817,1519.6762847896136]},\"74d09b8bdb4c5048\":{\"id\":\"74d09b8bdb4c5048\",\"name\":\"bitbybit.occt.shapes.face.subdivideToRectangleHoles\",\"customName\":\"subdivide to rectangle holes\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"nrRectanglesU\":1,\"nrRectanglesV\":1,\"holesToFaces\":true,\"offsetFromBorderU\":0,\"offsetFromBorderV\":0.02},\"inputs\":{\"shape\":{\"connections\":[{\"node\":\"db2f29c28fce9a44\",\"output\":\"result\",\"data\":{}}]},\"scalePatternV\":{\"connections\":[{\"node\":\"6f4928a56906774a\",\"output\":\"list\",\"data\":{}}]},\"inclusionPattern\":{\"connections\":[{\"node\":\"03303a3d3cb2a6b5\",\"output\":\"result\",\"data\":{}}]},\"nrRectanglesV\":{\"connections\":[{\"node\":\"d90e74b18631a7e7\",\"output\":\"result\",\"data\":{}}]}},\"position\":[3092.608348037154,1633.6879372044598]},\"db2f29c28fce9a44\":{\"id\":\"db2f29c28fce9a44\",\"name\":\"bitbybit.lists.flatten\",\"customName\":\"flatten\",\"data\":{\"nrLevels\":1},\"inputs\":{\"list\":{\"connections\":[{\"node\":\"825b687b6334e027\",\"output\":\"result\",\"data\":{}}]}},\"position\":[2676.745386245579,1557.1555615832751]},\"ed8dca56f5a8e402\":{\"id\":\"ed8dca56f5a8e402\",\"name\":\"bitbybit.occt.shapes.shell.sewFaces\",\"customName\":\"sew faces\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"tolerance\":1e-7},\"inputs\":{\"shapes\":{\"connections\":[{\"node\":\"f3620701c3c1ae55\",\"output\":\"list\",\"data\":{}}]}},\"position\":[4717.860180433169,974.4537366731146]},\"f3620701c3c1ae55\":{\"id\":\"f3620701c3c1ae55\",\"name\":\"bitbybit.lists.createList\",\"customName\":\"create list\",\"data\":{},\"inputs\":{\"listElements\":{\"connections\":[{\"node\":\"7ea739c655493f9b\",\"output\":\"result\",\"data\":{}}]}},\"position\":[4391.51664332526,1126.3749180224165]},\"5a31954b0015e697\":{\"id\":\"5a31954b0015e697\",\"name\":\"bitbybit.lists.getItem\",\"customName\":\"get item\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"index\":0,\"clone\":true},\"inputs\":{\"list\":{\"connections\":[{\"node\":\"74d09b8bdb4c5048\",\"output\":\"result\",\"data\":{}}]}},\"position\":[3583.928722911858,1609.7248549515402]},\"198a03b80b487592\":{\"id\":\"198a03b80b487592\",\"name\":\"bitbybit.math.number\",\"customName\":\"number\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"number\":0.75},\"inputs\":{},\"position\":[2390.350829226262,1944.6338134400619]},\"6f4928a56906774a\":{\"id\":\"6f4928a56906774a\",\"name\":\"bitbybit.lists.createList\",\"customName\":\"create list\",\"data\":{},\"inputs\":{\"listElements\":{\"connections\":[{\"node\":\"198a03b80b487592\",\"output\":\"result\",\"data\":{}},{\"node\":\"feef4ec0e40282e7\",\"output\":\"result\",\"data\":{}}]}},\"position\":[2699.5900851326587,1981.4990347629055]},\"b14378ceb8bf7fc5\":{\"id\":\"b14378ceb8bf7fc5\",\"name\":\"bitbybit.occt.transforms.scale3d\",\"customName\":\"scale 3d\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"scale\":[1,1,1],\"center\":[0,0,0]},\"inputs\":{\"center\":{\"connections\":[{\"node\":\"719d567df8fbd349\",\"output\":\"result\",\"data\":{}}]},\"scale\":{\"connections\":[{\"node\":\"efb0980b63aa8487\",\"output\":\"result\",\"data\":{}}]},\"shape\":{\"connections\":[{\"node\":\"a385c2492e4ef6f1\",\"output\":\"result\",\"data\":{}}]}},\"position\":[4341.167538667826,2759.8646823683453]},\"719d567df8fbd349\":{\"id\":\"719d567df8fbd349\",\"name\":\"bitbybit.vector.vectorXYZ\",\"customName\":\"vector xyz\",\"async\":false,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"x\":0,\"y\":0,\"z\":0},\"inputs\":{},\"position\":[3112.9806205260847,3674.4933141041506]},\"efb0980b63aa8487\":{\"id\":\"efb0980b63aa8487\",\"name\":\"bitbybit.vector.vectorXYZ\",\"customName\":\"vector xyz\",\"async\":false,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"x\":2,\"y\":1,\"z\":2},\"inputs\":{\"x\":{\"connections\":[{\"node\":\"80d8c2210e2c8ada\",\"output\":\"result\",\"data\":{}}]},\"z\":{\"connections\":[{\"node\":\"80d8c2210e2c8ada\",\"output\":\"result\",\"data\":{}}]}},\"position\":[3116.886056928245,2953.518975707273]},\"e5331e883d23938e\":{\"id\":\"e5331e883d23938e\",\"name\":\"bitbybit.occt.transforms.scale3d\",\"customName\":\"scale 3d\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"scale\":[1,1,1],\"center\":[0,0,0]},\"inputs\":{\"scale\":{\"connections\":[{\"node\":\"efb0980b63aa8487\",\"output\":\"result\",\"data\":{}}]},\"center\":{\"connections\":[{\"node\":\"719d567df8fbd349\",\"output\":\"result\",\"data\":{}}]},\"shape\":{\"connections\":[{\"node\":\"5a31954b0015e697\",\"output\":\"result\",\"data\":{}}]}},\"position\":[4356.028359232859,1903.9072650668625]},\"0a8bd4a673a282d0\":{\"id\":\"0a8bd4a673a282d0\",\"name\":\"bitbybit.lists.createList\",\"customName\":\"create list\",\"data\":{},\"inputs\":{\"listElements\":{\"connections\":[{\"node\":\"b6dab3ff34eb97a4\",\"output\":\"list\",\"data\":{}},{\"node\":\"a2a0a302a67ae9ff\",\"output\":\"list\",\"data\":{}}]}},\"position\":[5446.717449196535,2603.210206102196]},\"b6dab3ff34eb97a4\":{\"id\":\"b6dab3ff34eb97a4\",\"name\":\"bitbybit.lists.createList\",\"customName\":\"create list\",\"data\":{},\"inputs\":{\"listElements\":{\"connections\":[{\"node\":\"dd44e69c6aba7a0d\",\"output\":\"result\",\"data\":{}}]}},\"position\":[5014.862418857628,2443.6518849559025]},\"a2a0a302a67ae9ff\":{\"id\":\"a2a0a302a67ae9ff\",\"name\":\"bitbybit.lists.createList\",\"customName\":\"create list\",\"data\":{},\"inputs\":{\"listElements\":{\"connections\":[{\"node\":\"f9fb91cec187f7f0\",\"output\":\"result\",\"data\":{}}]}},\"position\":[5008.316988126108,2795.910343024419]},\"82d90ff3973291d4\":{\"id\":\"82d90ff3973291d4\",\"name\":\"bitbybit.lists.flipLists\",\"customName\":\"flip lists\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"clone\":true},\"inputs\":{\"list\":{\"connections\":[{\"node\":\"0a8bd4a673a282d0\",\"output\":\"list\",\"data\":{}}]}},\"position\":[5738.875610128508,2566.2260951248236]},\"9df5fcaa8f7c02cc\":{\"id\":\"9df5fcaa8f7c02cc\",\"name\":\"bitbybit.lists.flatten\",\"customName\":\"flatten\",\"data\":{\"nrLevels\":1},\"inputs\":{\"list\":{\"connections\":[{\"node\":\"82d90ff3973291d4\",\"output\":\"result\",\"data\":{}}]}},\"position\":[6058.59415221766,2603.0978039381016]},\"5a762f02bed474cd\":{\"id\":\"5a762f02bed474cd\",\"name\":\"bitbybit.occt.operations.loft\",\"customName\":\"loft\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"makeSolid\":false},\"inputs\":{\"shapes\":{\"connections\":[{\"node\":\"9df5fcaa8f7c02cc\",\"output\":\"result\",\"data\":{}}]}},\"position\":[6404.947065733184,2560.232098026223]},\"80d8c2210e2c8ada\":{\"id\":\"80d8c2210e2c8ada\",\"name\":\"bitbybit.math.number\",\"customName\":\"number\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"number\":1.2},\"inputs\":{},\"position\":[2535.8992541451094,3162.3018861132055]},\"fa96ae89f95b4b18\":{\"id\":\"fa96ae89f95b4b18\",\"name\":\"bitbybit.vector.vectorXYZ\",\"customName\":\"vector xyz\",\"async\":false,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"x\":-100,\"y\":-100,\"z\":-100},\"inputs\":{},\"position\":[1862.3555027829957,-1849.8844786271547]},\"9cd68061ec4fd9e0\":{\"id\":\"9cd68061ec4fd9e0\",\"name\":\"bitbybit.babylon.material.pbrMetallicRoughness.create\",\"customName\":\"pbr metallic roughness\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"name\":\"Custom Material\",\"baseColor\":\"#94c2ff\",\"emissiveColor\":\"#3b77b0\",\"metallic\":0.8,\"roughness\":0.29,\"alpha\":1,\"backFaceCulling\":false,\"zOffset\":2},\"inputs\":{},\"position\":[9605.741806654112,2831.949431044085]},\"3901011d12c76eef\":{\"id\":\"3901011d12c76eef\",\"name\":\"bitbybit.occt.transforms.scale3d\",\"customName\":\"scale 3d\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"scale\":[1,1,1],\"center\":[0,0,0]},\"inputs\":{\"shape\":{\"connections\":[{\"node\":\"47f69e3aabe06071\",\"output\":\"result\",\"data\":{}}]},\"scale\":{\"connections\":[{\"node\":\"efb0980b63aa8487\",\"output\":\"result\",\"data\":{}}]},\"center\":{\"connections\":[{\"node\":\"719d567df8fbd349\",\"output\":\"result\",\"data\":{}}]}},\"position\":[4364.581071106104,1476.346832014063]},\"3bc9cf346fc8ef2a\":{\"id\":\"3bc9cf346fc8ef2a\",\"name\":\"bitbybit.occt.transforms.scale3d\",\"customName\":\"scale 3d\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"scale\":[1,1,1],\"center\":[0,0,0]},\"inputs\":{\"shape\":{\"connections\":[{\"node\":\"e9b4d2a7926e953f\",\"output\":\"result\",\"data\":{}}]},\"center\":{\"connections\":[{\"node\":\"719d567df8fbd349\",\"output\":\"result\",\"data\":{}}]},\"scale\":{\"connections\":[{\"node\":\"43f2efdf3003002e\",\"output\":\"result\",\"data\":{}}]}},\"position\":[4345.11797828289,3210.3573065763057]},\"b313faa82fc7f582\":{\"id\":\"b313faa82fc7f582\",\"name\":\"bitbybit.lists.createList\",\"customName\":\"create list\",\"data\":{},\"inputs\":{\"listElements\":{\"connections\":[{\"node\":\"3901011d12c76eef\",\"output\":\"result\",\"data\":{}}]}},\"position\":[4860.068544678273,1517.2274588686575]},\"fda5ede008aae952\":{\"id\":\"fda5ede008aae952\",\"name\":\"bitbybit.occt.operations.loftAdvanced\",\"customName\":\"loft advanced\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"makeSolid\":false,\"closed\":false,\"periodic\":false,\"straight\":false,\"nrPeriodicSections\":10,\"useSmoothing\":false,\"maxUDegree\":3,\"tolerance\":1e-7,\"parType\":\"approxCentripetal\"},\"inputs\":{\"shapes\":{\"connections\":[{\"node\":\"b313faa82fc7f582\",\"output\":\"list\",\"data\":{}}]},\"startVertex\":{\"connections\":[{\"node\":\"cbacaf56751f477c\",\"output\":\"result\",\"data\":{}}]}},\"position\":[5327.662487993239,1465.5007248302118]},\"cbacaf56751f477c\":{\"id\":\"cbacaf56751f477c\",\"name\":\"bitbybit.vector.vectorXYZ\",\"customName\":\"vector xyz\",\"async\":false,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"x\":0,\"y\":32,\"z\":0},\"inputs\":{},\"position\":[4910.618536230501,1875.6153539025163]},\"43f2efdf3003002e\":{\"id\":\"43f2efdf3003002e\",\"name\":\"bitbybit.vector.vectorXYZ\",\"customName\":\"vector xyz\",\"async\":false,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"x\":2,\"y\":1,\"z\":2},\"inputs\":{\"x\":{\"connections\":[{\"node\":\"80d8c2210e2c8ada\",\"output\":\"result\",\"data\":{}}]},\"y\":{\"connections\":[{\"node\":\"80d8c2210e2c8ada\",\"output\":\"result\",\"data\":{}}]},\"z\":{\"connections\":[{\"node\":\"80d8c2210e2c8ada\",\"output\":\"result\",\"data\":{}}]}},\"position\":[3110.961471038728,3310.5951164909416]},\"7ea739c655493f9b\":{\"id\":\"7ea739c655493f9b\",\"name\":\"bitbybit.occt.shapes.face.reversedFace\",\"customName\":\"reversed face\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false}},\"inputs\":{\"shape\":{\"connections\":[{\"node\":\"5a31954b0015e697\",\"output\":\"result\",\"data\":{}}]}},\"position\":[4008.2380004947863,1087.5384630463477]},\"ff3a5dfe26c1203f\":{\"id\":\"ff3a5dfe26c1203f\",\"name\":\"bitbybit.occt.transforms.scale\",\"customName\":\"scale\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"factor\":0.5},\"inputs\":{\"shape\":{\"connections\":[{\"node\":\"d533f9b2b358e932\",\"output\":\"result\",\"data\":{}}]}},\"position\":[9189.222022342807,640.7663938760614]},\"36d87d3e5dda7cfb\":{\"id\":\"36d87d3e5dda7cfb\",\"name\":\"bitbybit.babylon.scene.drawDirectionalLight\",\"customName\":\"draw directional light\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"direction\":[-100,-100,-100],\"intensity\":3,\"diffuse\":\"#0084ff\",\"specular\":\"#ffffff\",\"shadowGeneratorMapSize\":1024,\"enableShadows\":true,\"shadowDarkness\":0,\"shadowUsePercentageCloserFiltering\":true,\"shadowContactHardeningLightSizeUVRatio\":0.2,\"shadowBias\":0.0001,\"shadowNormalBias\":0.002,\"shadowMaxZ\":1000,\"shadowMinZ\":0},\"inputs\":{\"direction\":{\"connections\":[{\"node\":\"9c598c3fd358e209\",\"output\":\"result\",\"data\":{}}]}},\"position\":[2410.492548455645,-1108.187459661422]},\"9c598c3fd358e209\":{\"id\":\"9c598c3fd358e209\",\"name\":\"bitbybit.vector.vectorXYZ\",\"customName\":\"vector xyz\",\"async\":false,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"x\":-100,\"y\":50,\"z\":-100},\"inputs\":{},\"position\":[1866.1241234045078,-1104.6216865423542]},\"dd44e69c6aba7a0d\":{\"id\":\"dd44e69c6aba7a0d\",\"name\":\"bitbybit.occt.shapes.wire.getWires\",\"customName\":\"get wires\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":1,\"forceExecution\":false}},\"inputs\":{\"shape\":{\"connections\":[{\"node\":\"a385c2492e4ef6f1\",\"output\":\"result\",\"data\":{}}]}},\"position\":[4354.892794420823,2367.2120176828043]},\"f9fb91cec187f7f0\":{\"id\":\"f9fb91cec187f7f0\",\"name\":\"bitbybit.occt.shapes.wire.getWires\",\"customName\":\"get wires\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":1,\"forceExecution\":false}},\"inputs\":{\"shape\":{\"connections\":[{\"node\":\"b14378ceb8bf7fc5\",\"output\":\"result\",\"data\":{}}]}},\"position\":[4682.071021905679,2782.246685007575]},\"ca83297771d11aa5\":{\"id\":\"ca83297771d11aa5\",\"name\":\"bitbybit.lists.removeItemAtIndex\",\"customName\":\"remove item at index\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"index\":0,\"clone\":true},\"inputs\":{\"list\":{\"connections\":[{\"node\":\"74d09b8bdb4c5048\",\"output\":\"result\",\"data\":{}}]}},\"position\":[3558.8739387013798,1967.9824675636294]},\"a385c2492e4ef6f1\":{\"id\":\"a385c2492e4ef6f1\",\"name\":\"bitbybit.lists.flatten\",\"customName\":\"flatten\",\"data\":{\"nrLevels\":1},\"inputs\":{\"list\":{\"connections\":[{\"node\":\"ca83297771d11aa5\",\"output\":\"result\",\"data\":{}}]}},\"position\":[4016.6293284317,2616.607395641203]},\"42f74d68d23d3247\":{\"id\":\"42f74d68d23d3247\",\"name\":\"bitbybit.babylon.scene.fog\",\"customName\":\"fog\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"mode\":\"linear\",\"color\":\"#c9c9c9\",\"density\":0.1,\"start\":35,\"end\":100},\"inputs\":{\"color\":{\"connections\":[{\"node\":\"7b75db43179570c8\",\"output\":\"result\",\"data\":{}}]}},\"position\":[2442.8735698720834,-42.14590401627983]},\"7b75db43179570c8\":{\"id\":\"7b75db43179570c8\",\"name\":\"bitbybit.color.hexColor\",\"customName\":\"hex color\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"color\":\"#8397aa\"},\"inputs\":{},\"position\":[2098.232163729327,-306.933632265146]},\"8f5c08c8c98f4eb6\":{\"id\":\"8f5c08c8c98f4eb6\",\"name\":\"bitbybit.babylon.gui.advancedDynamicTexture.createFullScreenUI\",\"customName\":\"full screen ui\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"name\":\"fullscreen\",\"foreground\":true,\"adaptiveScaling\":false},\"inputs\":{},\"position\":[-1056.7184739683328,2836.232260686571]},\"62013821226fbd05\":{\"id\":\"62013821226fbd05\",\"name\":\"bitbybit.babylon.gui.container.addControls\",\"customName\":\"add controls\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"clearControlsFirst\":true},\"inputs\":{\"controls\":{\"connections\":[{\"node\":\"5d70cbf01bf83e55\",\"output\":\"list\",\"data\":{}}]},\"container\":{\"connections\":[{\"node\":\"8f5c08c8c98f4eb6\",\"output\":\"result\",\"data\":{}}]}},\"position\":[1051.4522897911515,2825.729196003556]},\"5d70cbf01bf83e55\":{\"id\":\"5d70cbf01bf83e55\",\"name\":\"bitbybit.lists.createList\",\"customName\":\"create list\",\"data\":{},\"inputs\":{\"listElements\":{\"connections\":[{\"node\":\"d7157cf9080bd8c5\",\"output\":\"result\",\"data\":{}}]}},\"position\":[779.1858107406395,3260.0028960769355]},\"6ea6f5c19d2c3679\":{\"id\":\"6ea6f5c19d2c3679\",\"name\":\"bitbybit.babylon.gui.stackPanel.createStackPanel\",\"customName\":\"stack panel\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"name\":\"stackPanel\",\"isVertical\":true,\"spacing\":25,\"color\":\"#00000000\",\"background\":\"#00000000\"},\"inputs\":{\"width\":{\"connections\":[{\"node\":\"1c3567b107487ab7\",\"output\":\"result\",\"data\":{}}]},\"height\":{\"connections\":[{\"node\":\"2cfa0a89722e88ad\",\"output\":\"result\",\"data\":{}}]}},\"position\":[-644.7439786868175,3305.091365601621]},\"1c3567b107487ab7\":{\"id\":\"1c3567b107487ab7\",\"name\":\"bitbybit.text.create\",\"customName\":\"create\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"740px\"},\"inputs\":{},\"position\":[-1005.9218465842323,3360.972335833377]},\"2cfa0a89722e88ad\":{\"id\":\"2cfa0a89722e88ad\",\"name\":\"bitbybit.text.create\",\"customName\":\"create\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"850px\"},\"inputs\":{},\"position\":[-1015.568499809784,3636.3340536899586]},\"7256842476045eb7\":{\"id\":\"7256842476045eb7\",\"name\":\"bitbybit.babylon.gui.control.changeControlAlignment\",\"customName\":\"change control alignment\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"horizontalAlignment\":\"left\",\"verticalAlignment\":\"bottom\"},\"inputs\":{\"control\":{\"connections\":[{\"node\":\"6ea6f5c19d2c3679\",\"output\":\"result\",\"data\":{}}]}},\"position\":[-55.86693666910121,3469.4026625427564]},\"d7157cf9080bd8c5\":{\"id\":\"d7157cf9080bd8c5\",\"name\":\"bitbybit.babylon.gui.control.changeControlPadding\",\"customName\":\"change control padding\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false}},\"inputs\":{\"control\":{\"connections\":[{\"node\":\"7256842476045eb7\",\"output\":\"result\",\"data\":{}}]},\"paddingLeft\":{\"connections\":[{\"node\":\"2e27ec0382325605\",\"output\":\"result\",\"data\":{}}]},\"paddingRight\":{\"connections\":[{\"node\":\"2e27ec0382325605\",\"output\":\"result\",\"data\":{}}]},\"paddingTop\":{\"connections\":[{\"node\":\"2e27ec0382325605\",\"output\":\"result\",\"data\":{}}]},\"paddingBottom\":{\"connections\":[{\"node\":\"2e27ec0382325605\",\"output\":\"result\",\"data\":{}}]}},\"position\":[374.0302769524635,3524.3010854904096]},\"2e27ec0382325605\":{\"id\":\"2e27ec0382325605\",\"name\":\"bitbybit.text.create\",\"customName\":\"create\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"35px\"},\"inputs\":{},\"position\":[38.94193286015155,3917.4311588521]},\"bbd88144625e447e\":{\"id\":\"bbd88144625e447e\",\"name\":\"bitbybit.babylon.gui.container.addControls\",\"customName\":\"add controls\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"clearControlsFirst\":true},\"inputs\":{\"container\":{\"connections\":[{\"node\":\"d7157cf9080bd8c5\",\"output\":\"result\",\"data\":{}}]},\"controls\":{\"connections\":[{\"node\":\"688df756a4d3edd8\",\"output\":\"list\",\"data\":{}}]}},\"position\":[1117.0240712398745,3999.2649441995045]},\"688df756a4d3edd8\":{\"id\":\"688df756a4d3edd8\",\"name\":\"bitbybit.lists.createList\",\"customName\":\"create list\",\"data\":{},\"inputs\":{\"listElements\":{\"connections\":[{\"node\":\"a67fb013d25c1008\",\"output\":\"result\",\"data\":{}}]}},\"position\":[808.172430927605,4141.539962993023]},\"a67fb013d25c1008\":{\"id\":\"a67fb013d25c1008\",\"name\":\"bitbybit.babylon.gui.control.changeControlPadding\",\"customName\":\"change control padding\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false}},\"inputs\":{\"paddingLeft\":{\"connections\":[{\"node\":\"2e27ec0382325605\",\"output\":\"result\",\"data\":{}}]},\"paddingRight\":{\"connections\":[{\"node\":\"2e27ec0382325605\",\"output\":\"result\",\"data\":{}}]},\"paddingTop\":{\"connections\":[{\"node\":\"2e27ec0382325605\",\"output\":\"result\",\"data\":{}}]},\"paddingBottom\":{\"connections\":[{\"node\":\"2e27ec0382325605\",\"output\":\"result\",\"data\":{}}]},\"control\":{\"connections\":[{\"node\":\"8019c3f4a93360fc\",\"output\":\"result\",\"data\":{}}]}},\"position\":[381.53080329328145,4124.938450095269]},\"8019c3f4a93360fc\":{\"id\":\"8019c3f4a93360fc\",\"name\":\"bitbybit.babylon.gui.stackPanel.createStackPanel\",\"customName\":\"stack panel\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"name\":\"stackPanel\",\"isVertical\":true,\"spacing\":32,\"color\":\"#00000000\",\"background\":\"#00000055\"},\"inputs\":{\"width\":{\"connections\":[{\"node\":\"c7771b05bfece223\",\"output\":\"result\",\"data\":{}}]},\"height\":{\"connections\":[{\"node\":\"c7771b05bfece223\",\"output\":\"result\",\"data\":{}}]}},\"position\":[-634.5679617178588,4122.829976185915]},\"c7771b05bfece223\":{\"id\":\"c7771b05bfece223\",\"name\":\"bitbybit.math.number\",\"customName\":\"number\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"number\":1},\"inputs\":{},\"position\":[-1030.5012301905765,4255.332320202711]},\"3cdac0a2da52d477\":{\"id\":\"3cdac0a2da52d477\",\"name\":\"bitbybit.babylon.gui.textBlock.createTextBlock\",\"customName\":\"text block\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"name\":\"textBlockName\",\"text\":\"❄️❄️❄️🎄 TOY 🎄❄️❄️❄️\",\"color\":\"#f0cebb\",\"fontSize\":43},\"inputs\":{\"color\":{\"connections\":[{\"node\":\"14ea460327313f84\",\"output\":\"result\",\"data\":{}}]},\"height\":{\"connections\":[{\"node\":\"8fdac6b820e66385\",\"output\":\"result\",\"data\":{}}]}},\"position\":[-853.8406515994363,5107.457479372801]},\"4c68d9ac771b698a\":{\"id\":\"4c68d9ac771b698a\",\"name\":\"bitbybit.babylon.gui.container.addControls\",\"customName\":\"add controls\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"clearControlsFirst\":true},\"inputs\":{\"container\":{\"connections\":[{\"node\":\"a67fb013d25c1008\",\"output\":\"result\",\"data\":{}}]},\"controls\":{\"connections\":[{\"node\":\"40ad5c91b680fe5b\",\"output\":\"list\",\"data\":{}}]}},\"position\":[1081.1735221113568,4989.645601752394]},\"40ad5c91b680fe5b\":{\"id\":\"40ad5c91b680fe5b\",\"name\":\"bitbybit.lists.createList\",\"customName\":\"create list\",\"data\":{},\"inputs\":{\"listElements\":{\"connections\":[{\"node\":\"3cdac0a2da52d477\",\"output\":\"result\",\"data\":{}},{\"node\":\"eb164cb9f2c3d0b2\",\"output\":\"result\",\"data\":{}},{\"node\":\"f80263a3d6977ea4\",\"output\":\"result\",\"data\":{}},{\"node\":\"dda72ba4bc855075\",\"output\":\"result\",\"data\":{}},{\"node\":\"a3006cf7f5041ef6\",\"output\":\"result\",\"data\":{}},{\"node\":\"22b0aaced3db29ad\",\"output\":\"result\",\"data\":{}},{\"node\":\"9de26dfa0b6980e6\",\"output\":\"result\",\"data\":{}}]}},\"position\":[131.27159201850196,6807.45958474214]},\"14ea460327313f84\":{\"id\":\"14ea460327313f84\",\"name\":\"bitbybit.color.hexColor\",\"customName\":\"hex color\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"color\":\"#75a3ff\"},\"inputs\":{},\"position\":[-2524.347102647334,9183.15923769915]},\"be55efccc9dd82ed\":{\"id\":\"be55efccc9dd82ed\",\"name\":\"bitbybit.babylon.gui.control.changeControlPadding\",\"customName\":\"change control padding\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false}},\"inputs\":{\"control\":{\"connections\":[{\"node\":\"3cdac0a2da52d477\",\"output\":\"result\",\"data\":{}}]},\"paddingTop\":{\"connections\":[{\"node\":\"96b4e817c4c14f20\",\"output\":\"result\",\"data\":{}}]},\"paddingBottom\":{\"connections\":[{\"node\":\"f6b793e8e89edda0\",\"output\":\"result\",\"data\":{}}]}},\"position\":[310.06370891276634,5361.812652019315]},\"96b4e817c4c14f20\":{\"id\":\"96b4e817c4c14f20\",\"name\":\"bitbybit.text.create\",\"customName\":\"create\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"25px\"},\"inputs\":{},\"position\":[-216.81270824516469,5476.663754188035]},\"8fdac6b820e66385\":{\"id\":\"8fdac6b820e66385\",\"name\":\"bitbybit.text.create\",\"customName\":\"create\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"105px\"},\"inputs\":{},\"position\":[-1181.045524940636,5460.547434196808]},\"eb164cb9f2c3d0b2\":{\"id\":\"eb164cb9f2c3d0b2\",\"name\":\"bitbybit.babylon.gui.slider.createSlider\",\"customName\":\"slider\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"name\":\"rays\",\"minimum\":3,\"maximum\":12,\"value\":6,\"step\":1,\"isVertical\":false,\"color\":\"#f0cebb\",\"background\":\"black\",\"displayThumb\":true},\"inputs\":{\"value\":{\"connections\":[{\"node\":\"6e51a85f13ab5259\",\"output\":\"result\",\"data\":{}}]},\"color\":{\"connections\":[{\"node\":\"14ea460327313f84\",\"output\":\"result\",\"data\":{}}]}},\"position\":[-821.5978737310934,5908.02843885303]},\"6e51a85f13ab5259\":{\"id\":\"6e51a85f13ab5259\",\"name\":\"bitbybit.math.numberSlider\",\"customName\":\"number slider\",\"data\":{\"options\":{\"min\":3,\"max\":12,\"step\":1,\"width\":350,\"updateOnDrag\":false},\"number\":5},\"inputs\":{},\"position\":[-1455.2743568834462,6056.45799565296]},\"f80263a3d6977ea4\":{\"id\":\"f80263a3d6977ea4\",\"name\":\"bitbybit.babylon.gui.textBlock.createTextBlock\",\"customName\":\"text block\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"name\":\"textBlockName\",\"text\":\"Number Of Rays\",\"color\":\"#f0cebb\",\"fontSize\":32},\"inputs\":{\"color\":{\"connections\":[{\"node\":\"14ea460327313f84\",\"output\":\"result\",\"data\":{}}]}},\"position\":[-853.88650164059,6570.290388610167]},\"dda72ba4bc855075\":{\"id\":\"dda72ba4bc855075\",\"name\":\"bitbybit.babylon.gui.slider.createSlider\",\"customName\":\"slider\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"name\":\"verticalOpeningsSlider\",\"minimum\":1,\"maximum\":25,\"value\":6,\"step\":1,\"isVertical\":false,\"color\":\"#f0cebb\",\"background\":\"black\",\"displayThumb\":true},\"inputs\":{\"value\":{\"connections\":[{\"node\":\"dc27ec58598933e4\",\"output\":\"result\",\"data\":{}}]},\"color\":{\"connections\":[{\"node\":\"14ea460327313f84\",\"output\":\"result\",\"data\":{}}]}},\"position\":[-831.8855421151479,7040.183968957487]},\"dc27ec58598933e4\":{\"id\":\"dc27ec58598933e4\",\"name\":\"bitbybit.math.numberSlider\",\"customName\":\"number slider\",\"data\":{\"options\":{\"min\":1,\"max\":25,\"step\":1,\"width\":350,\"updateOnDrag\":false},\"number\":5},\"inputs\":{},\"position\":[-1548.5643926124947,7215.153436337072]},\"a3006cf7f5041ef6\":{\"id\":\"a3006cf7f5041ef6\",\"name\":\"bitbybit.babylon.gui.textBlock.createTextBlock\",\"customName\":\"text block\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"name\":\"textBlockName\",\"text\":\"Vertical Divisions\",\"color\":\"#f0cebb\",\"fontSize\":32},\"inputs\":{\"color\":{\"connections\":[{\"node\":\"14ea460327313f84\",\"output\":\"result\",\"data\":{}}]}},\"position\":[-829.5105024166364,7718.522342332688]},\"22b0aaced3db29ad\":{\"id\":\"22b0aaced3db29ad\",\"name\":\"bitbybit.babylon.gui.button.createSimpleButton\",\"customName\":\"simple button\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"name\":\"buttonName\",\"label\":\"S I G N U P F O R M O R E !\",\"color\":\"white\",\"background\":\"#f0cebb\",\"fontSize\":32},\"inputs\":{\"background\":{\"connections\":[{\"node\":\"14ea460327313f84\",\"output\":\"result\",\"data\":{}}]},\"height\":{\"connections\":[{\"node\":\"b5ab513337ea1f9c\",\"output\":\"result\",\"data\":{}}]}},\"position\":[-846.86829904502,8223.84317108378]},\"b5ab513337ea1f9c\":{\"id\":\"b5ab513337ea1f9c\",\"name\":\"bitbybit.text.create\",\"customName\":\"create\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"95px\"},\"inputs\":{},\"position\":[-1211.515140544501,8409.866247193688]},\"3d74af9c8a8b1dd3\":{\"id\":\"3d74af9c8a8b1dd3\",\"name\":\"bitbybit.babylon.gui.control.changeControlPadding\",\"customName\":\"change control padding\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false}},\"inputs\":{\"control\":{\"connections\":[{\"node\":\"22b0aaced3db29ad\",\"output\":\"result\",\"data\":{}}]},\"paddingLeft\":{\"connections\":[{\"node\":\"f49f0b323ff33034\",\"output\":\"result\",\"data\":{}}]},\"paddingRight\":{\"connections\":[{\"node\":\"f49f0b323ff33034\",\"output\":\"result\",\"data\":{}}]}},\"position\":[147.85415967299022,8465.334888215139]},\"f49f0b323ff33034\":{\"id\":\"f49f0b323ff33034\",\"name\":\"bitbybit.text.create\",\"customName\":\"create\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"32px\"},\"inputs\":{},\"position\":[-351.90583473376483,8527.624810198047]},\"9de26dfa0b6980e6\":{\"id\":\"9de26dfa0b6980e6\",\"name\":\"bitbybit.babylon.gui.stackPanel.createStackPanel\",\"customName\":\"stack panel\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"name\":\"actions\",\"isVertical\":false,\"spacing\":20,\"color\":\"#00000000\",\"background\":\"#00000055\"},\"inputs\":{\"height\":{\"connections\":[{\"node\":\"94be48fa3d341e2f\",\"output\":\"result\",\"data\":{}}]}},\"position\":[-860.4566955224043,8845.655587065246]},\"94be48fa3d341e2f\":{\"id\":\"94be48fa3d341e2f\",\"name\":\"bitbybit.text.create\",\"customName\":\"create\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"150px\"},\"inputs\":{},\"position\":[-1243.8502616502608,8996.109487316298]},\"386aa0fba070069e\":{\"id\":\"386aa0fba070069e\",\"name\":\"bitbybit.lists.createList\",\"customName\":\"create list\",\"data\":{},\"inputs\":{\"listElements\":{\"connections\":[{\"node\":\"fc36f702c3f8146e\",\"output\":\"result\",\"data\":{}},{\"node\":\"71fbc1ccee37d577\",\"output\":\"result\",\"data\":{}},{\"node\":\"dfd5ec0585a0e37f\",\"output\":\"result\",\"data\":{}}]}},\"position\":[86.09946070310812,9675.048597360192]},\"fc36f702c3f8146e\":{\"id\":\"fc36f702c3f8146e\",\"name\":\"bitbybit.babylon.gui.button.createSimpleButton\",\"customName\":\"simple button\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"name\":\"getStep\",\"label\":\"Get STEP\",\"color\":\"white\",\"background\":\"black\",\"fontSize\":24},\"inputs\":{\"width\":{\"connections\":[{\"node\":\"9627abcea218d31f\",\"output\":\"result\",\"data\":{}}]},\"height\":{\"connections\":[{\"node\":\"5189291d4a0b99c3\",\"output\":\"result\",\"data\":{}}]},\"color\":{\"connections\":[{\"node\":\"14ea460327313f84\",\"output\":\"result\",\"data\":{}}]}},\"position\":[-906.5263779292032,9503.72186483339]},\"9627abcea218d31f\":{\"id\":\"9627abcea218d31f\",\"name\":\"bitbybit.text.create\",\"customName\":\"create\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"186px\"},\"inputs\":{},\"position\":[-1280.2041644956794,9443.521680268339]},\"5189291d4a0b99c3\":{\"id\":\"5189291d4a0b99c3\",\"name\":\"bitbybit.math.number\",\"customName\":\"number\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"number\":0.5},\"inputs\":{},\"position\":[-1336.124164455853,9763.964706483723]},\"b42caf22b316e228\":{\"id\":\"b42caf22b316e228\",\"name\":\"bitbybit.babylon.gui.container.addControls\",\"customName\":\"add controls\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"clearControlsFirst\":true},\"inputs\":{\"controls\":{\"connections\":[{\"node\":\"386aa0fba070069e\",\"output\":\"list\",\"data\":{}}]},\"container\":{\"connections\":[{\"node\":\"9de5622b3e543a8a\",\"output\":\"result\",\"data\":{}}]}},\"position\":[1052.8239083530739,9110.88729112261]},\"27161889f007dc04\":{\"id\":\"27161889f007dc04\",\"name\":\"bitbybit.babylon.gui.control.changeControlAlignment\",\"customName\":\"change control alignment\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"horizontalAlignment\":\"center\",\"verticalAlignment\":\"center\"},\"inputs\":{\"control\":{\"connections\":[{\"node\":\"9de26dfa0b6980e6\",\"output\":\"result\",\"data\":{}}]}},\"position\":[-269.69695321588506,8927.379602739795]},\"71fbc1ccee37d577\":{\"id\":\"71fbc1ccee37d577\",\"name\":\"bitbybit.babylon.gui.button.createSimpleButton\",\"customName\":\"simple button\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"name\":\"getStl\",\"label\":\"Get STL\",\"color\":\"white\",\"background\":\"black\",\"fontSize\":24},\"inputs\":{\"width\":{\"connections\":[{\"node\":\"9627abcea218d31f\",\"output\":\"result\",\"data\":{}}]},\"height\":{\"connections\":[{\"node\":\"5189291d4a0b99c3\",\"output\":\"result\",\"data\":{}}]},\"color\":{\"connections\":[{\"node\":\"14ea460327313f84\",\"output\":\"result\",\"data\":{}}]}},\"position\":[-906.6855973027857,10056.533240815332]},\"dfd5ec0585a0e37f\":{\"id\":\"dfd5ec0585a0e37f\",\"name\":\"bitbybit.babylon.gui.button.createSimpleButton\",\"customName\":\"simple button\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"name\":\"sourceCode\",\"label\":\"Source Code\",\"color\":\"white\",\"background\":\"black\",\"fontSize\":24},\"inputs\":{\"color\":{\"connections\":[{\"node\":\"14ea460327313f84\",\"output\":\"result\",\"data\":{}}]},\"height\":{\"connections\":[{\"node\":\"5189291d4a0b99c3\",\"output\":\"result\",\"data\":{}}]},\"width\":{\"connections\":[{\"node\":\"9627abcea218d31f\",\"output\":\"result\",\"data\":{}}]}},\"position\":[-906.7686354515675,10569.423308562755]},\"9de5622b3e543a8a\":{\"id\":\"9de5622b3e543a8a\",\"name\":\"bitbybit.babylon.gui.control.changeControlPadding\",\"customName\":\"change control padding\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false}},\"inputs\":{\"paddingTop\":{\"connections\":[{\"node\":\"ce084356ce41072e\",\"output\":\"result\",\"data\":{}}]},\"control\":{\"connections\":[{\"node\":\"27161889f007dc04\",\"output\":\"result\",\"data\":{}}]},\"paddingLeft\":{\"connections\":[{\"node\":\"ce084356ce41072e\",\"output\":\"result\",\"data\":{}}]},\"paddingRight\":{\"connections\":[{\"node\":\"ce084356ce41072e\",\"output\":\"result\",\"data\":{}}]},\"paddingBottom\":{\"connections\":[{\"node\":\"ce084356ce41072e\",\"output\":\"result\",\"data\":{}}]}},\"position\":[386.5736003150091,9022.420560407636]},\"ce084356ce41072e\":{\"id\":\"ce084356ce41072e\",\"name\":\"bitbybit.text.create\",\"customName\":\"create\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"0px\"},\"inputs\":{},\"position\":[-150.892111299047,9269.41326836467]},\"3b1402c27d9aa4d9\":{\"id\":\"3b1402c27d9aa4d9\",\"name\":\"bitbybit.babylon.gui.control.changeControlPadding\",\"customName\":\"change control padding\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false}},\"inputs\":{\"paddingTop\":{\"connections\":[{\"node\":\"7c43fbf3b4039859\",\"output\":\"result\",\"data\":{}}]},\"control\":{\"connections\":[{\"node\":\"22b0aaced3db29ad\",\"output\":\"result\",\"data\":{}}]}},\"position\":[468.6889889862706,7806.3724958885105]},\"7c43fbf3b4039859\":{\"id\":\"7c43fbf3b4039859\",\"name\":\"bitbybit.text.create\",\"customName\":\"create\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"40px\"},\"inputs\":{},\"position\":[38.94985237381003,8082.178454308819]},\"bf021b750fd00e30\":{\"id\":\"bf021b750fd00e30\",\"name\":\"bitbybit.text.create\",\"customName\":\"create\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"45px\"},\"inputs\":{},\"position\":[-26.956821924678025,4278.492442388621]},\"f6b793e8e89edda0\":{\"id\":\"f6b793e8e89edda0\",\"name\":\"bitbybit.text.create\",\"customName\":\"create\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"35px\"},\"inputs\":{},\"position\":[-204.24116761177675,5756.856375833485]},\"f1f8cf3eadfa0ebb\":{\"id\":\"f1f8cf3eadfa0ebb\",\"name\":\"bitbybit.babylon.gui.control.createControlObservableSelector\",\"customName\":\"control observable selector\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"selector\":\"onPointerUpObservable\"},\"inputs\":{},\"position\":[-284.4470112110814,10728.8905088672]},\"43441120529c36e3\":{\"id\":\"43441120529c36e3\",\"name\":\"bitbybit.flow.babylon.observableListener\",\"customName\":\"babylon observable listener\",\"data\":{},\"inputs\":{\"observableSelector\":{\"connections\":[{\"node\":\"f1f8cf3eadfa0ebb\",\"output\":\"result\",\"data\":{}}]},\"object\":{\"connections\":[{\"node\":\"dfd5ec0585a0e37f\",\"output\":\"result\",\"data\":{}}]}},\"position\":[379.3161481874706,10607.903050757823]},\"38f701184db60233\":{\"id\":\"38f701184db60233\",\"name\":\"bitbybit.flow.time.delay\",\"customName\":\"delay\",\"data\":{\"timeout\":0},\"inputs\":{\"exec\":{\"connections\":[{\"node\":\"43441120529c36e3\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[933.2062286858425,10749.580736333644]},\"fbe1705ff510913a\":{\"id\":\"fbe1705ff510913a\",\"name\":\"bitbybit.flow.logic.flipFlop\",\"customName\":\"flip flop\",\"data\":{},\"inputs\":{\"exec\":{\"connections\":[{\"node\":\"43441120529c36e3\",\"output\":\"exec\",\"data\":{}},{\"node\":\"38f701184db60233\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[1286.7786245546422,10638.06142237177]},\"83ffa041662302e3\":{\"id\":\"83ffa041662302e3\",\"name\":\"bitbybit.code.typeScriptEditor\",\"customName\":\"typescript editor\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":true},\"code\":{\"code\":\"// DO NOT REMOVE THIS FUNCTION\\nconst start83ffa041662302e3 = async (inputs: any, index: number) => {\\n // ADD YOUR CODE HERE\\n if (inputs === true) {\\n window.open(\\\"https://bitbybit.dev/app/bitbybit/KtIymkYFZ8Qty9h8mhew/Y7NQIgaXLy0dqffnc825?editor=rete\\\", '_blank').focus();\\n }\\n return inputs;\\n}\"}},\"inputs\":{\"inputs\":{\"connections\":[{\"node\":\"fbe1705ff510913a\",\"output\":\"isA\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"fbe1705ff510913a\",\"output\":\"execA\",\"data\":{}},{\"node\":\"fbe1705ff510913a\",\"output\":\"execB\",\"data\":{}}]}},\"position\":[1749.7763306366996,10636.786904135595]},\"af7350efdb0b85b3\":{\"id\":\"af7350efdb0b85b3\",\"name\":\"bitbybit.babylon.gui.control.createControlObservableSelector\",\"customName\":\"control observable selector\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"selector\":\"onPointerUpObservable\"},\"inputs\":{},\"position\":[686.4715121547069,8508.681235887017]},\"f2e18ffd18566787\":{\"id\":\"f2e18ffd18566787\",\"name\":\"bitbybit.flow.babylon.observableListener\",\"customName\":\"babylon observable listener\",\"data\":{},\"inputs\":{\"object\":{\"connections\":[{\"node\":\"22b0aaced3db29ad\",\"output\":\"result\",\"data\":{}}]},\"observableSelector\":{\"connections\":[{\"node\":\"af7350efdb0b85b3\",\"output\":\"result\",\"data\":{}}]}},\"position\":[1453.070365919411,8258.538315404885]},\"70259fc69f3db105\":{\"id\":\"70259fc69f3db105\",\"name\":\"bitbybit.flow.time.delay\",\"customName\":\"delay\",\"data\":{\"timeout\":0},\"inputs\":{\"exec\":{\"connections\":[{\"node\":\"f2e18ffd18566787\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[1987.6045976314351,8437.042718662588]},\"291c95f88aae5725\":{\"id\":\"291c95f88aae5725\",\"name\":\"bitbybit.flow.logic.flipFlop\",\"customName\":\"flip flop\",\"data\":{},\"inputs\":{\"exec\":{\"connections\":[{\"node\":\"70259fc69f3db105\",\"output\":\"exec\",\"data\":{}},{\"node\":\"f2e18ffd18566787\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[2323.4070267726706,8288.053843144928]},\"ac5f02670de06852\":{\"id\":\"ac5f02670de06852\",\"name\":\"bitbybit.code.typeScriptEditor\",\"customName\":\"typescript editor\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":true},\"code\":{\"code\":\"// DO NOT REMOVE THIS FUNCTION\\nconst startac5f02670de06852 = async (inputs: any, index: number) => {\\n // ADD YOUR CODE HERE\\n if (inputs === true) {\\n window.open(\\\"https://bitbybit.dev/auth/sign-up\\\", '_blank').focus();\\n }\\n return inputs;\\n}\"}},\"inputs\":{\"inputs\":{\"connections\":[{\"node\":\"291c95f88aae5725\",\"output\":\"isA\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"291c95f88aae5725\",\"output\":\"execA\",\"data\":{}},{\"node\":\"291c95f88aae5725\",\"output\":\"execB\",\"data\":{}}]}},\"position\":[2681.990286952205,8287.587249893892]},\"b5af9279ffdd84e5\":{\"id\":\"b5af9279ffdd84e5\",\"name\":\"bitbybit.babylon.scene.enableSkybox\",\"customName\":\"enable skybox\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"skybox\":\"city\",\"size\":1000,\"blur\":0.5,\"environmentIntensity\":0.7,\"hideSkybox\":false},\"inputs\":{},\"position\":[2884.1306675480555,-186.0490873535386]},\"9dca219fedacecca\":{\"id\":\"9dca219fedacecca\",\"name\":\"bitbybit.flow.babylon.observableListener\",\"customName\":\"babylon observable listener\",\"data\":{},\"inputs\":{\"observableSelector\":{\"connections\":[{\"node\":\"f1f8cf3eadfa0ebb\",\"output\":\"result\",\"data\":{}}]},\"object\":{\"connections\":[{\"node\":\"71fbc1ccee37d577\",\"output\":\"result\",\"data\":{}}]}},\"position\":[385.9268891419183,10329.874563653837]},\"bb201b1ec9f17a1e\":{\"id\":\"bb201b1ec9f17a1e\",\"name\":\"bitbybit.flow.babylon.observableListener\",\"customName\":\"babylon observable listener\",\"data\":{},\"inputs\":{\"observableSelector\":{\"connections\":[{\"node\":\"f1f8cf3eadfa0ebb\",\"output\":\"result\",\"data\":{}}]},\"object\":{\"connections\":[{\"node\":\"fc36f702c3f8146e\",\"output\":\"result\",\"data\":{}}]}},\"position\":[394.16500271911553,10076.96114156523]},\"4a5d1c196a0b447e\":{\"id\":\"4a5d1c196a0b447e\",\"name\":\"bitbybit.flow.time.delay\",\"customName\":\"delay\",\"data\":{\"timeout\":0},\"inputs\":{\"exec\":{\"connections\":[{\"node\":\"9dca219fedacecca\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[936.4095297912264,10457.862715124222]},\"4fd171db189ad173\":{\"id\":\"4fd171db189ad173\",\"name\":\"bitbybit.flow.logic.flipFlop\",\"customName\":\"flip flop\",\"data\":{},\"inputs\":{\"exec\":{\"connections\":[{\"node\":\"9dca219fedacecca\",\"output\":\"exec\",\"data\":{}},{\"node\":\"4a5d1c196a0b447e\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[1273.654131279585,10355.281487174021]},\"94b6dd1354940df2\":{\"id\":\"94b6dd1354940df2\",\"name\":\"bitbybit.flow.time.delay\",\"customName\":\"delay\",\"data\":{\"timeout\":0},\"inputs\":{\"exec\":{\"connections\":[{\"node\":\"bb201b1ec9f17a1e\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[926.4956949832613,10212.522265939324]},\"27eac850201a9701\":{\"id\":\"27eac850201a9701\",\"name\":\"bitbybit.flow.logic.flipFlop\",\"customName\":\"flip flop\",\"data\":{},\"inputs\":{\"exec\":{\"connections\":[{\"node\":\"bb201b1ec9f17a1e\",\"output\":\"exec\",\"data\":{}},{\"node\":\"94b6dd1354940df2\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[1272.0778730255988,10103.055278248028]},\"9190095ec9cfd394\":{\"id\":\"9190095ec9cfd394\",\"name\":\"bitbybit.logic.valueGate\",\"customName\":\"value gate\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"boolean\":false},\"inputs\":{\"value\":{\"connections\":[{\"node\":\"73ee3cd6670755bb\",\"output\":\"result\",\"data\":{}}]},\"boolean\":{\"connections\":[{\"node\":\"27eac850201a9701\",\"output\":\"isA\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"27eac850201a9701\",\"output\":\"execA\",\"data\":{}},{\"node\":\"27eac850201a9701\",\"output\":\"execB\",\"data\":{}}]}},\"position\":[2098.7596218076405,9630.876889007699]},\"73ee3cd6670755bb\":{\"id\":\"73ee3cd6670755bb\",\"name\":\"bitbybit.text.create\",\"customName\":\"create\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"bitbybit-toy.step\"},\"inputs\":{},\"position\":[1701.8222304032442,9540.575618331815]},\"f9a87606405961ae\":{\"id\":\"f9a87606405961ae\",\"name\":\"bitbybit.text.create\",\"customName\":\"create\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"bitbybit-toy.stl\"},\"inputs\":{},\"position\":[1934.0481177357838,10057.705993169464]},\"f8db44954a566616\":{\"id\":\"f8db44954a566616\",\"name\":\"bitbybit.logic.valueGate\",\"customName\":\"value gate\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"boolean\":false},\"inputs\":{\"value\":{\"connections\":[{\"node\":\"f9a87606405961ae\",\"output\":\"result\",\"data\":{}}]},\"boolean\":{\"connections\":[{\"node\":\"4fd171db189ad173\",\"output\":\"isA\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"4fd171db189ad173\",\"output\":\"execA\",\"data\":{}},{\"node\":\"4fd171db189ad173\",\"output\":\"execB\",\"data\":{}}]}},\"position\":[2360.5651787274305,10179.991268481712]},\"7ae3f1f373ab7ce8\":{\"id\":\"7ae3f1f373ab7ce8\",\"name\":\"bitbybit.occt.io.saveShapeSTEPAndReturn\",\"customName\":\"save shape step and return\",\"async\":true,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"fileName\":\"\",\"adjustYtoZ\":true,\"fromRightHanded\":false,\"tryDownload\":true},\"inputs\":{\"shape\":{\"connections\":[{\"node\":\"ff3a5dfe26c1203f\",\"output\":\"result\",\"data\":{}}]},\"fileName\":{\"connections\":[{\"node\":\"9190095ec9cfd394\",\"output\":\"result\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"9190095ec9cfd394\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[4105.580503617983,9860.933809645778]},\"b358af77da1782cf\":{\"id\":\"b358af77da1782cf\",\"name\":\"bitbybit.occt.io.saveShapeStl\",\"customName\":\"save shape stl\",\"async\":true,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"fileName\":\"shape.stl\",\"precision\":0.01,\"adjustYtoZ\":true,\"tryDownload\":true,\"binary\":true},\"inputs\":{\"fileName\":{\"connections\":[{\"node\":\"f8db44954a566616\",\"output\":\"result\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"f8db44954a566616\",\"output\":\"exec\",\"data\":{}}]},\"shape\":{\"connections\":[{\"node\":\"ff3a5dfe26c1203f\",\"output\":\"result\",\"data\":{}}]}},\"position\":[4097.343815578738,10313.986149668373]},\"feef4ec0e40282e7\":{\"id\":\"feef4ec0e40282e7\",\"name\":\"bitbybit.math.number\",\"customName\":\"number\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"number\":0.5},\"inputs\":{},\"position\":[2389.4392361815517,2241.565476619029]},\"03303a3d3cb2a6b5\":{\"id\":\"03303a3d3cb2a6b5\",\"name\":\"bitbybit.json.parse\",\"customName\":\"parse\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"[true,false,true,true]\"},\"inputs\":{},\"position\":[2389.302212365796,2597.6283579746796]},\"f39c312f7e1e1bef\":{\"id\":\"f39c312f7e1e1bef\",\"name\":\"bitbybit.flow.babylon.observableListener\",\"customName\":\"babylon observable listener\",\"data\":{},\"inputs\":{\"observableSelector\":{\"connections\":[{\"node\":\"19dd5abb3a2ed30a\",\"output\":\"result\",\"data\":{}}]},\"object\":{\"connections\":[{\"node\":\"dda72ba4bc855075\",\"output\":\"result\",\"data\":{}}]}},\"position\":[634.3045048773648,6411.35023828563]},\"19dd5abb3a2ed30a\":{\"id\":\"19dd5abb3a2ed30a\",\"name\":\"bitbybit.babylon.gui.slider.createSliderObservableSelector\",\"customName\":\"slider observable selector\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"selector\":\"onValueChangedObservable\"},\"inputs\":{},\"position\":[119.33402358269528,6252.634270289916]},\"3f3e9efb919889cb\":{\"id\":\"3f3e9efb919889cb\",\"name\":\"bitbybit.flow.babylon.observableListener\",\"customName\":\"babylon observable listener\",\"data\":{},\"inputs\":{\"observableSelector\":{\"connections\":[{\"node\":\"19dd5abb3a2ed30a\",\"output\":\"result\",\"data\":{}}]},\"object\":{\"connections\":[{\"node\":\"eb164cb9f2c3d0b2\",\"output\":\"result\",\"data\":{}}]}},\"position\":[626.2393558517689,6035.026931379336]},\"b85e303f418ea094\":{\"id\":\"b85e303f418ea094\",\"name\":\"bitbybit.flow.babylon.getEventDataFromObservedResult\",\"customName\":\"get event data\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false}},\"inputs\":{\"json\":{\"connections\":[{\"node\":\"3f3e9efb919889cb\",\"output\":\"result\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"3f3e9efb919889cb\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[1213.8284182083087,6031.8004190176025]},\"0ae184887b347212\":{\"id\":\"0ae184887b347212\",\"name\":\"bitbybit.flow.babylon.getEventDataFromObservedResult\",\"customName\":\"get event data\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false}},\"inputs\":{\"exec\":{\"connections\":[{\"node\":\"f39c312f7e1e1bef\",\"output\":\"exec\",\"data\":{}}]},\"json\":{\"connections\":[{\"node\":\"f39c312f7e1e1bef\",\"output\":\"result\",\"data\":{}}]}},\"position\":[1212.113699374194,6401.279001431719]},\"ffecd6164df0c288\":{\"id\":\"ffecd6164df0c288\",\"name\":\"bitbybit.logic.firstDefinedValueGate\",\"customName\":\"first defined value gate\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false}},\"inputs\":{\"value1\":{\"connections\":[{\"node\":\"b85e303f418ea094\",\"output\":\"result\",\"data\":{}}]},\"value2\":{\"connections\":[{\"node\":\"6e51a85f13ab5259\",\"output\":\"result\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"b85e303f418ea094\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[1795.1547936226411,6012.662361553964]},\"d90e74b18631a7e7\":{\"id\":\"d90e74b18631a7e7\",\"name\":\"bitbybit.logic.firstDefinedValueGate\",\"customName\":\"first defined value gate\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false}},\"inputs\":{\"exec\":{\"connections\":[{\"node\":\"0ae184887b347212\",\"output\":\"exec\",\"data\":{}}]},\"value2\":{\"connections\":[{\"node\":\"dc27ec58598933e4\",\"output\":\"result\",\"data\":{}}]},\"value1\":{\"connections\":[{\"node\":\"0ae184887b347212\",\"output\":\"result\",\"data\":{}}]}},\"position\":[1827.0393870782336,6490.834733956343]},\"9ed742a672a607ce\":{\"id\":\"9ed742a672a607ce\",\"name\":\"bitbybit.lists.createList\",\"customName\":\"create list\",\"data\":{},\"inputs\":{\"listElements\":{\"connections\":[{\"node\":\"ffecd6164df0c288\",\"output\":\"result\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"ffecd6164df0c288\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[2408.212815313349,6050.3207511429555]},\"48046af83dbc9299\":{\"id\":\"48046af83dbc9299\",\"name\":\"bitbybit.lists.createList\",\"customName\":\"create list\",\"data\":{},\"inputs\":{\"listElements\":{\"connections\":[{\"node\":\"d90e74b18631a7e7\",\"output\":\"result\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"d90e74b18631a7e7\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[2407.3069815807094,6523.841211518347]},\"46f99a9e9cfc9152\":{\"id\":\"46f99a9e9cfc9152\",\"name\":\"bitbybit.text.format\",\"customName\":\"format\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"Number Of Rays - {0}\",\"values\":[\"World\"]},\"inputs\":{\"values\":{\"connections\":[{\"node\":\"9ed742a672a607ce\",\"output\":\"list\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"9ed742a672a607ce\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[2774.3846965928947,5974.2361780617475]},\"ced830dd20fb5b02\":{\"id\":\"ced830dd20fb5b02\",\"name\":\"bitbybit.text.format\",\"customName\":\"format\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"Vertical Divsions - {0}\",\"values\":[\"World\"]},\"inputs\":{\"exec\":{\"connections\":[{\"node\":\"48046af83dbc9299\",\"output\":\"exec\",\"data\":{}}]},\"values\":{\"connections\":[{\"node\":\"48046af83dbc9299\",\"output\":\"list\",\"data\":{}}]}},\"position\":[2794.9763891153702,6450.397669292677]},\"af2cb4893a5bc1cb\":{\"id\":\"af2cb4893a5bc1cb\",\"name\":\"bitbybit.babylon.gui.textBlock.setText\",\"customName\":\"set text\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"\"},\"inputs\":{\"text\":{\"connections\":[{\"node\":\"46f99a9e9cfc9152\",\"output\":\"result\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"46f99a9e9cfc9152\",\"output\":\"exec\",\"data\":{}}]},\"textBlock\":{\"connections\":[{\"node\":\"f80263a3d6977ea4\",\"output\":\"result\",\"data\":{}}]}},\"position\":[3408.9286383465733,6175.853417797766]},\"bb5fa4b16d910cb5\":{\"id\":\"bb5fa4b16d910cb5\",\"name\":\"bitbybit.babylon.gui.textBlock.setText\",\"customName\":\"set text\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"text\":\"\"},\"inputs\":{\"textBlock\":{\"connections\":[{\"node\":\"a3006cf7f5041ef6\",\"output\":\"result\",\"data\":{}}]},\"text\":{\"connections\":[{\"node\":\"ced830dd20fb5b02\",\"output\":\"result\",\"data\":{}}]},\"exec\":{\"connections\":[{\"node\":\"ced830dd20fb5b02\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[3443.5303027369487,6538.552534619226]},\"8ecfa2d91d973882\":{\"id\":\"8ecfa2d91d973882\",\"name\":\"bitbybit.babylon.gui.control.createControlObservableSelector\",\"customName\":\"control observable selector\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"selector\":\"onPointerUpObservable\"},\"inputs\":{},\"position\":[112.53197228874697,7216.911800887681]},\"8478c18af95701d2\":{\"id\":\"8478c18af95701d2\",\"name\":\"bitbybit.flow.babylon.observableListener\",\"customName\":\"babylon observable listener\",\"data\":{},\"inputs\":{\"observableSelector\":{\"connections\":[{\"node\":\"8ecfa2d91d973882\",\"output\":\"result\",\"data\":{}}]},\"object\":{\"connections\":[{\"node\":\"dda72ba4bc855075\",\"output\":\"result\",\"data\":{}}]}},\"position\":[666.0061734678349,7042.204203322666]},\"fa5a486b0621317a\":{\"id\":\"fa5a486b0621317a\",\"name\":\"bitbybit.flow.babylon.observableListener\",\"customName\":\"babylon observable listener\",\"data\":{},\"inputs\":{\"observableSelector\":{\"connections\":[{\"node\":\"8ecfa2d91d973882\",\"output\":\"result\",\"data\":{}}]},\"object\":{\"connections\":[{\"node\":\"eb164cb9f2c3d0b2\",\"output\":\"result\",\"data\":{}}]}},\"position\":[667.4427756519425,6826.609623951564]},\"7299a501c8e860c5\":{\"id\":\"7299a501c8e860c5\",\"name\":\"bitbybit.lists.passThrough\",\"customName\":\"pass through\",\"data\":{},\"inputs\":{\"exec\":{\"connections\":[{\"node\":\"fa5a486b0621317a\",\"output\":\"exec\",\"data\":{}},{\"node\":\"8478c18af95701d2\",\"output\":\"exec\",\"data\":{}}]}},\"position\":[6778.4019145441225,6945.999036012015]},\"68fc3da5a920f715\":{\"id\":\"68fc3da5a920f715\",\"name\":\"bitbybit.babylon.scene.adjustActiveArcRotateCamera\",\"customName\":\"adjust active arc rotate camera\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"position\":[10,10,10],\"lookAt\":[0,0,0],\"lowerBetaLimit\":1,\"upperBetaLimit\":179,\"angularSensibilityX\":1000,\"angularSensibilityY\":1000,\"maxZ\":1000,\"panningSensibility\":1000,\"wheelPrecision\":3},\"inputs\":{\"position\":{\"connections\":[{\"node\":\"2c23a73974610198\",\"output\":\"result\",\"data\":{}}]},\"lookAt\":{\"connections\":[{\"node\":\"4b908f56b3ed505c\",\"output\":\"result\",\"data\":{}}]}},\"position\":[2457.6836534900826,-2687.8751308577216]},\"2c23a73974610198\":{\"id\":\"2c23a73974610198\",\"name\":\"bitbybit.vector.vectorXYZ\",\"customName\":\"vector xyz\",\"async\":false,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"x\":30,\"y\":25,\"z\":0},\"inputs\":{},\"position\":[2028.1960653764377,-2763.197379436671]},\"4b908f56b3ed505c\":{\"id\":\"4b908f56b3ed505c\",\"name\":\"bitbybit.vector.vectorXYZ\",\"customName\":\"vector xyz\",\"async\":false,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"x\":0,\"y\":4,\"z\":0},\"inputs\":{},\"position\":[2033.62438677469,-2317.355175655833]}}}","version":"0.21.0","type":"rete"}} title="Christmas tree ornament" /> diff --git a/docs/learn/code/common/occt/modeling/festive-decor/tree.md b/docs/learn/code/common/occt/modeling/festive-decor/tree.md index 9ba5bd41..bc11ea9c 100644 --- a/docs/learn/code/common/occt/modeling/festive-decor/tree.md +++ b/docs/learn/code/common/occt/modeling/festive-decor/tree.md @@ -28,21 +28,21 @@ Our tree starts with the `createChristmasTreeWire` function, which generates a s heightnrSkirtsthicknesstreeWireoffsetWirereversedWiretreeFacetreeSolidfinalTreedrawnTreeMeshheight8nrSkirts4thickness2treeWireheight1.53nrSkirts11FALSE0000010offsetWiretreeWire-0.20.1reversedWireoffsetWiretreeFacetreeWirereversedWireTRUEtreeSolidtreeFace00thicknessfinalTreetreeSolid00DIVIDENEGthickness2drawnTreeMeshfinalTree0.001Tree Material#ffffff#00ffcc0.80.991FALSE2TRUE#0000001drawnTreeMeshTRUE0.80TRUE","version":"0.20.14","type":"blockly"}} + script={{"script":"heightnrSkirtsthicknesstreeWireoffsetWirereversedWiretreeFacetreeSolidfinalTreedrawnTreeMeshheight8nrSkirts4thickness2treeWireheight1.53nrSkirts11FALSE0000010offsetWiretreeWire-0.20.1reversedWireoffsetWiretreeFacetreeWirereversedWireTRUEtreeSolidtreeFace00thicknessfinalTreetreeSolid00DIVIDENEGthickness2drawnTreeMeshfinalTree0.001Tree Material#ffffff#00ffcc0.80.991FALSE2TRUE#0000001drawnTreeMeshTRUE0.80TRUE","version":"0.21.0","type":"blockly"}} title="Christmas tree ornament" /> {\n // Define control variables\n const height = 6.5;\n const nrSkirts = 5;\n const thickness = 0.5;\n\n // Create PBR material with emissive glow\n const materialOptions = new PBRMetallicRoughnessDto();\n materialOptions.name = \"Tree Material\";\n materialOptions.baseColor = \"#ffffff\";\n materialOptions.emissiveColor = \"#00ffcc\";\n materialOptions.metallic = 0.8;\n materialOptions.roughness = 0.99;\n materialOptions.alpha = 1;\n materialOptions.backFaceCulling = false;\n materialOptions.zOffset = 2;\n const material = bitbybit.babylon.material.pbrMetallicRoughness.create(materialOptions);\n\n // Create the Christmas tree wire\n const treeOptions = new ChristmasTreeDto();\n treeOptions.height = height;\n treeOptions.nrSkirts = nrSkirts;\n treeOptions.innerDist = 1.5;\n treeOptions.outerDist = 3;\n treeOptions.trunkHeight = 1;\n treeOptions.trunkWidth = 1;\n treeOptions.origin = [0, 0, 0];\n treeOptions.direction = [0, 1, 0];\n treeOptions.half = false;\n const treeWire = await wire.createChristmasTreeWire(treeOptions);\n\n // Create offset wire (inner boundary)\n const offsetOptions = new OffsetDto();\n offsetOptions.shape = treeWire;\n offsetOptions.distance = -0.2;\n offsetOptions.tolerance = 0.1;\n const offsetWire = await operations.offset(offsetOptions);\n\n // Reverse the inner wire for proper face creation\n const reversedWire = await wire.reversedWire({ shape: offsetWire });\n\n // Create face from both wires (outer and reversed inner)\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = [treeWire, reversedWire];\n faceOptions.planar = true;\n const treeFace = await face.createFaceFromWires(faceOptions);\n\n // Extrude the face to create thickness\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = treeFace;\n extrudeOptions.direction = [0, 0, thickness];\n const treeSolid = await operations.extrude(extrudeOptions);\n\n // Translate to center the shape\n const translateOptions = new TranslateDto();\n translateOptions.shape = treeSolid;\n translateOptions.translation = [0, 0, -thickness / 2];\n const finalTree = await transforms.translate(translateOptions);\n\n // Draw with custom material and edge styling\n const drawOptions = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n drawOptions.precision = 0.001;\n drawOptions.drawEdges = true;\n drawOptions.edgeColour = \"#000000\";\n drawOptions.edgeWidth = 1;\n drawOptions.faceMaterial = material;\n\n const drawnTreeMesh = await bitbybit.draw.drawAnyAsync({\n entity: finalTree,\n options: drawOptions\n });\n\n const zoomOptions = new ZoomOnDto([drawnTreeMesh]);\n bitbybit.advanced.navigation.zoomOn(zoomOptions);\n}\n\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const { ChristmasTreeDto, OffsetDto, FaceFromWiresDto, ExtrudeDto, TranslateDto } = Bit.Inputs.OCCT;\nconst { PBRMetallicRoughnessDto } = Bit.Inputs.BabylonMaterial;\nconst { ZoomOnDto } = Bit.Advanced.Navigation;\n\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer;\n\nconst { wire, face } = bitbybit.occt.shapes;\nconst { operations, transforms } = bitbybit.occt;\n\nconst start = async () => {\n // Define control variables\n const height = 6.5;\n const nrSkirts = 5;\n const thickness = 0.5;\n\n // Create PBR material with emissive glow\n const materialOptions = new PBRMetallicRoughnessDto();\n materialOptions.name = \"Tree Material\";\n materialOptions.baseColor = \"#ffffff\";\n materialOptions.emissiveColor = \"#00ffcc\";\n materialOptions.metallic = 0.8;\n materialOptions.roughness = 0.99;\n materialOptions.alpha = 1;\n materialOptions.backFaceCulling = false;\n materialOptions.zOffset = 2;\n const material = bitbybit.babylon.material.pbrMetallicRoughness.create(materialOptions);\n\n // Create the Christmas tree wire\n const treeOptions = new ChristmasTreeDto();\n treeOptions.height = height;\n treeOptions.nrSkirts = nrSkirts;\n treeOptions.innerDist = 1.5;\n treeOptions.outerDist = 3;\n treeOptions.trunkHeight = 1;\n treeOptions.trunkWidth = 1;\n treeOptions.origin = [0, 0, 0];\n treeOptions.direction = [0, 1, 0];\n treeOptions.half = false;\n const treeWire = await wire.createChristmasTreeWire(treeOptions);\n\n // Create offset wire (inner boundary)\n const offsetOptions = new OffsetDto();\n offsetOptions.shape = treeWire;\n offsetOptions.distance = -0.2;\n offsetOptions.tolerance = 0.1;\n const offsetWire = await operations.offset(offsetOptions);\n\n // Reverse the inner wire for proper face creation\n const reversedWire = await wire.reversedWire({ shape: offsetWire });\n\n // Create face from both wires (outer and reversed inner)\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = [treeWire, reversedWire];\n faceOptions.planar = true;\n const treeFace = await face.createFaceFromWires(faceOptions);\n\n // Extrude the face to create thickness\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = treeFace;\n extrudeOptions.direction = [0, 0, thickness];\n const treeSolid = await operations.extrude(extrudeOptions);\n\n // Translate to center the shape\n const translateOptions = new TranslateDto();\n translateOptions.shape = treeSolid;\n translateOptions.translation = [0, 0, -thickness / 2];\n const finalTree = await transforms.translate(translateOptions);\n\n // Draw with custom material and edge styling\n const drawOptions = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n drawOptions.precision = 0.001;\n drawOptions.drawEdges = true;\n drawOptions.edgeColour = \"#000000\";\n drawOptions.edgeWidth = 1;\n drawOptions.faceMaterial = material;\n\n const drawnTreeMesh = await bitbybit.draw.drawAnyAsync({\n entity: finalTree,\n options: drawOptions\n });\n\n const zoomOptions = new ZoomOnDto([drawnTreeMesh]);\n bitbybit.advanced.navigation.zoomOn(zoomOptions);\n}\n\nstart();","version":"0.21.0","type":"typescript"}} title="Christmas tree ornament" /> diff --git a/docs/learn/code/common/occt/modeling/festive-decor/twisted-polygon-ornament.md b/docs/learn/code/common/occt/modeling/festive-decor/twisted-polygon-ornament.md new file mode 100644 index 00000000..95a0aaea --- /dev/null +++ b/docs/learn/code/common/occt/modeling/festive-decor/twisted-polygon-ornament.md @@ -0,0 +1,82 @@ +--- +sidebar_position: 5 +title: Twisted Polygon Ornament +sidebar_label: Twisted Polygon Ornament +description: Learn how to create an elegant twisted polygon ornament by transforming and lofting hexagonal wires - perfect for 3D printing decorative pieces. +tags: [code, occt, rete, blockly, typescript] +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import BitByBitRenderCanvas from '@site/src/components/BitByBitRenderCanvas'; + +OCCT category icon with a stylized logo representation + +Create an elegant twisted ornament by systematically rotating and scaling hexagonal wire profiles, then connecting them with a lofting operation. This produces a sophisticated spiraling form from simple geometric transformations. + + + + + + + nrCornerswire1wire2wire3wire4list1list2ianglefactortempShapefinalListitemloftShapeunifiedShape'city'10000.230.7TRUEnrCorners6wire1000010nrCorners1wire200.10010nrCorners1wire300.20010nrCorners1wire400.30010nrCorners1list1list2i0101angleMULTIPLYi9factorADDi1tempShapewire1001angletempShapetempShapefactorINSERTLASTlist1tempShapetempShapewire2001angletempShapetempShapefactorINSERTLASTlist1tempShapetempShapewire4001angletempShapetempShapefactorINSERTLASTlist2tempShapetempShapewire3001angletempShapetempShapefactorINSERTLASTlist2tempShapelist1list1TRUElist2list2TRUETRUEfinalListitemlist2INSERTLASTfinalListitemitemlist1INSERTLASTfinalListitemfinalListfinalListTRUEloftShapefinalListFALSETRUEFALSETRUE10FALSE31e-7approxCentripetalunifiedShapeloftShapeTRUETRUETRUEunifiedShape0.01Custom Material#94ffd1#0000000.90.31FALSE2TRUE#ffffff2","version":"0.21.0","type":"blockly"}} + title="Twisted Polygon Ornament" + /> + + + {\n\n const skyboxOpt = new SkyboxDto();\n skyboxOpt.skybox = skyboxEnum.city;\n skyboxOpt.hideSkybox = true;\n bitbybit.babylon.scene.enableSkybox(skyboxOpt);\n\n const nrCorners = 6;\n\n // 1. Create Base Wires\n const ngonDto = new NGonWireDto();\n ngonDto.nrCorners = nrCorners;\n ngonDto.direction = [0, 1, 0];\n ngonDto.radius = 1;\n\n ngonDto.center = [0, 0, 0];\n const wire1 = await wire.createNGonWire(ngonDto);\n\n ngonDto.center = [0, 0.1, 0];\n const wire2 = await wire.createNGonWire(ngonDto);\n\n ngonDto.center = [0, 0.2, 0];\n const wire3 = await wire.createNGonWire(ngonDto);\n\n ngonDto.center = [0, 0.3, 0];\n const wire4 = await wire.createNGonWire(ngonDto);\n\n // 2. Generate Lists of Transformed Wires\n const list1: TopoDSShapePointer[] = [];\n const list2: TopoDSShapePointer[] = [];\n\n for (let i = 0; i <= 10; i++) {\n const angle = i * 9;\n const factor = i + 1;\n\n // Helper to rotate and scale\n const transform = async (w: TopoDSShapePointer) => {\n const rotDto = new RotateDto();\n rotDto.shape = w;\n rotDto.axis = [0, 0, 1];\n rotDto.angle = angle;\n const rotated = await transforms.rotate(rotDto);\n\n const scaleDto = new ScaleDto();\n scaleDto.shape = rotated;\n scaleDto.factor = factor;\n return await transforms.scale(scaleDto);\n };\n\n list1.push(await transform(wire1));\n list1.push(await transform(wire2));\n list2.push(await transform(wire3));\n list2.push(await transform(wire4));\n }\n\n // 3. Process Lists\n // Remove first item from list1\n list1.shift();\n // Reverse list2 and remove last item\n list2.reverse();\n list2.shift();\n list2.pop();\n\n // 4. Merge and Reverse Final List\n // Merge: list2 items then list1 items\n let finalList = [...list2, ...list1];\n\n // Reverse the final list for the loft direction\n finalList.reverse();\n\n // 5. Loft\n const loftDto = new LoftAdvancedDto();\n loftDto.shapes = finalList;\n loftDto.makeSolid = false;\n loftDto.closed = true;\n loftDto.periodic = false;\n loftDto.straight = true;\n loftDto.nrPeriodicSections = 10;\n loftDto.useSmoothing = false;\n loftDto.maxUDegree = 3;\n loftDto.tolerance = 1e-7;\n loftDto.parType = approxParametrizationTypeEnum.approxCentripetal;\n const loftShape = await operations.loftAdvanced(loftDto);\n\n // 6. Unify Domain\n const unifyDto = new UnifySameDomainDto();\n unifyDto.shape = loftShape;\n unifyDto.unifyEdges = true;\n unifyDto.unifyFaces = true;\n unifyDto.concatBSplines = true;\n const unifiedShape = await shape.unifySameDomain(unifyDto);\n\n // 7. Draw\n const materialOptions = new PBRMetallicRoughnessDto();\n materialOptions.name = 'Custom Material';\n materialOptions.baseColor = '#94ffd1';\n materialOptions.emissiveColor = '#000000';\n materialOptions.metallic = 0.9;\n materialOptions.roughness = 0.3;\n materialOptions.alpha = 1;\n materialOptions.backFaceCulling = false;\n materialOptions.zOffset = 2;\n const material = bitbybit.babylon.material.pbrMetallicRoughness.create(materialOptions);\n\n const drawOptions = new DrawOcctShapeOptions();\n drawOptions.precision = 0.01;\n drawOptions.drawEdges = true;\n drawOptions.edgeColour = '#ffffff';\n drawOptions.edgeWidth = 2;\n drawOptions.faceMaterial = material;\n\n const drawnMesh = await bitbybit.draw.drawAnyAsync({\n entity: unifiedShape,\n options: drawOptions,\n });\n\n const zoomDto = new ZoomOnDto();\n zoomDto.meshes = [drawnMesh];\n bitbybit.advanced.navigation.zoomOn(zoomDto);\n};\n\nstart();","version":"0.21.0","type":"typescript"}} +title="Twisted Polygon Ornament" +/> + + + +## How It Works + +The algorithm creates a twisted ornament by stacking transformed hexagonal profiles. We start with four base hexagons at different heights, then generate eleven iterations where each step rotates by 9 degrees and scales progressively larger. This creates a smooth spiraling form that expands outward as it rises. + +The technique uses two separate lists to control the twist direction. After transforming all profiles, we carefully arrange and reverse these lists before connecting them with a lofting operation. The loft creates smooth surfaces between profiles using straight transitions, maintaining crisp edges while achieving an organic twisted appearance. Finally, a unification step cleans up the geometry by merging adjacent faces and edges. + +## Algorithm Steps + +``` +1. Create four base hexagon wires at heights: 0, 0.1, 0.2, 0.3 + +2. For each iteration i from 0 to 10: + - Calculate angle = i × 9 degrees + - Calculate scale factor = i + 1 + - Transform wires 1 and 2 → add to list1 + - Transform wires 3 and 4 → add to list2 + +3. Process lists: + - Remove first item from list1 + - Reverse list2, then remove first and last items + +4. Combine lists: + - Merge list2 + list1 → finalList + - Reverse finalList + +5. Loft profiles: + - Connect all profiles with straight transitions + - Create closed, non-periodic surface + +6. Unify geometry: + - Merge coplanar faces + - Combine adjacent edges + +7. Render with metallic material and visible edges +``` + +Experiment with the number of polygon corners or rotation angle to create unique variations of this twisted form. + diff --git a/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-hive-flat.md b/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-hive-flat.md index c647526e..7b1fcd98 100644 --- a/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-hive-flat.md +++ b/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-hive-flat.md @@ -22,21 +22,21 @@ Flat hexagon hive construction creates optimized honeycomb panels by treating th widthheightnrHexWidthnrHexHeightwiresHexLargewiresHexSmallrandomHeightshexagonFacesiwidth10height20nrHexWidth10nrHexHeight20wiresHexLargewidthheightnrHexWidthnrHexHeightFALSEFALSEFALSEFALSEFALSEwiresHexSmallwidthheightnrHexWidthnrHexHeightFALSEFALSEFALSEFALSEFALSE0.70.7randomHeights12wiresHexLargehexagonFacesi1wiresHexLarge1INSERTLASThexagonFacesGETFROM_STARTwiresHexLargeiGETFROM_STARTwiresHexSmalliTRUEhexagonFaces1e-7TRUETRUETRUE010","version":"0.20.14","type":"blockly"}} + script={{"script":"widthheightnrHexWidthnrHexHeightwiresHexLargewiresHexSmallrandomHeightshexagonFacesiwidth10height20nrHexWidth10nrHexHeight20wiresHexLargewidthheightnrHexWidthnrHexHeightFALSEFALSEFALSEFALSEFALSEwiresHexSmallwidthheightnrHexWidthnrHexHeightFALSEFALSEFALSEFALSEFALSE0.70.7randomHeights12wiresHexLargehexagonFacesi1wiresHexLarge1INSERTLASThexagonFacesGETFROM_STARTwiresHexLargeiGETFROM_STARTwiresHexSmalliTRUEhexagonFaces1e-7TRUETRUETRUE010","version":"0.21.0","type":"blockly"}} title="Hexagon hive" /> {\n // Create hexagonal grid parameters\n const gridWidth = 10;\n const gridHeight = 20;\n const hexagonsInWidth = 10;\n const hexagonsInHeight = 20;\n\n // Generate large hexagonal wire grid (outer walls)\n const hexGridLargeOptions = new HexagonsInGridDto();\n hexGridLargeOptions.width = gridWidth;\n hexGridLargeOptions.height = gridHeight;\n hexGridLargeOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridLargeOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridLargeOptions.flatTop = false;\n hexGridLargeOptions.extendTop = false;\n hexGridLargeOptions.extendBottom = false;\n hexGridLargeOptions.extendLeft = false;\n hexGridLargeOptions.extendRight = false;\n\n const wiresHexLarge = await wire.hexagonsInGrid(hexGridLargeOptions);\n\n // Generate small hexagonal wire grid (inner holes)\n const hexGridSmallOptions = new HexagonsInGridDto();\n hexGridSmallOptions.width = gridWidth;\n hexGridSmallOptions.height = gridHeight;\n hexGridSmallOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridSmallOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridSmallOptions.flatTop = false;\n hexGridSmallOptions.extendTop = false;\n hexGridSmallOptions.extendBottom = false;\n hexGridSmallOptions.extendLeft = false;\n hexGridSmallOptions.extendRight = false;\n hexGridSmallOptions.scalePatternWidth = [0.7];\n hexGridSmallOptions.scalePatternHeight = [0.7];\n\n const wiresHexSmall = await wire.hexagonsInGrid(hexGridSmallOptions);\n\n // Generate random heights for creating individual faces\n const randomHeights = math.randomNumbers({\n low: 1,\n high: 2,\n count: wiresHexLarge.length\n });\n\n // Create faces with holes for each hexagon cell\n const hexagonFaces: TopoDSFacePointer[] = [];\n for (let i = 0; i < wiresHexLarge.length; i++) {\n // Get the outer and inner wires for this cell\n const outerWire = wiresHexLarge[i];\n const innerWire = wiresHexSmall[i];\n\n // Reverse the inner wire to create a hole\n const reverseOptions = new ShapeDto();\n reverseOptions.shape = innerWire;\n const reversedInnerWire = await wire.reversedWire(reverseOptions);\n\n // Create face with hole\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = [outerWire, reversedInnerWire];\n faceOptions.planar = true;\n const hexFaceWithHole = await face.createFaceFromWires(faceOptions);\n\n hexagonFaces.push(hexFaceWithHole);\n }\n\n // Sew faces together\n const sewOptions = new SewDto(hexagonFaces);\n sewOptions.tolerance = 1e-7;\n const sewedFaces = await shell.sewFaces(sewOptions);\n\n // Unify same domain for cleaner geometry\n const unifyOptions = new UnifySameDomainDto();\n unifyOptions.shape = sewedFaces;\n unifyOptions.unifyEdges = true;\n unifyOptions.unifyFaces = true;\n unifyOptions.concatBSplines = true;\n const unifiedShape = await shape.unifySameDomain(unifyOptions);\n\n // Extrude the unified shape\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = unifiedShape;\n extrudeOptions.direction = [0, 1, 0];\n const extrudedHive = await operations.extrude(extrudeOptions);\n\n // Draw the resulting flat hive structure\n bitbybit.draw.drawAnyAsync({\n entity: extrudedHive\n });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs for hexagon grid creation and operations\nconst { HexagonsInGridDto, FaceFromWiresDto, ExtrudeDto, ShapesDto, SewDto, UnifySameDomainDto, ShapeDto } = Bit.Inputs.OCCT;\n// Import type definitions for type safety\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSShellPointer = Bit.Inputs.OCCT.TopoDSShellPointer;\ntype TopoDSSolidPointer = Bit.Inputs.OCCT.TopoDSSolidPointer;\n\n// Get access to OCCT modules and utilities\nconst { wire, face, shell, shape } = bitbybit.occt.shapes;\nconst { operations } = bitbybit.occt;\nconst { math } = bitbybit;\n\n// Define the main function to create a flat hexagon hive\nconst start = async () => {\n // Create hexagonal grid parameters\n const gridWidth = 10;\n const gridHeight = 20;\n const hexagonsInWidth = 10;\n const hexagonsInHeight = 20;\n\n // Generate large hexagonal wire grid (outer walls)\n const hexGridLargeOptions = new HexagonsInGridDto();\n hexGridLargeOptions.width = gridWidth;\n hexGridLargeOptions.height = gridHeight;\n hexGridLargeOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridLargeOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridLargeOptions.flatTop = false;\n hexGridLargeOptions.extendTop = false;\n hexGridLargeOptions.extendBottom = false;\n hexGridLargeOptions.extendLeft = false;\n hexGridLargeOptions.extendRight = false;\n\n const wiresHexLarge = await wire.hexagonsInGrid(hexGridLargeOptions);\n\n // Generate small hexagonal wire grid (inner holes)\n const hexGridSmallOptions = new HexagonsInGridDto();\n hexGridSmallOptions.width = gridWidth;\n hexGridSmallOptions.height = gridHeight;\n hexGridSmallOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridSmallOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridSmallOptions.flatTop = false;\n hexGridSmallOptions.extendTop = false;\n hexGridSmallOptions.extendBottom = false;\n hexGridSmallOptions.extendLeft = false;\n hexGridSmallOptions.extendRight = false;\n hexGridSmallOptions.scalePatternWidth = [0.7];\n hexGridSmallOptions.scalePatternHeight = [0.7];\n\n const wiresHexSmall = await wire.hexagonsInGrid(hexGridSmallOptions);\n\n // Generate random heights for creating individual faces\n const randomHeights = math.randomNumbers({\n low: 1,\n high: 2,\n count: wiresHexLarge.length\n });\n\n // Create faces with holes for each hexagon cell\n const hexagonFaces: TopoDSFacePointer[] = [];\n for (let i = 0; i < wiresHexLarge.length; i++) {\n // Get the outer and inner wires for this cell\n const outerWire = wiresHexLarge[i];\n const innerWire = wiresHexSmall[i];\n\n // Reverse the inner wire to create a hole\n const reverseOptions = new ShapeDto();\n reverseOptions.shape = innerWire;\n const reversedInnerWire = await wire.reversedWire(reverseOptions);\n\n // Create face with hole\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = [outerWire, reversedInnerWire];\n faceOptions.planar = true;\n const hexFaceWithHole = await face.createFaceFromWires(faceOptions);\n\n hexagonFaces.push(hexFaceWithHole);\n }\n\n // Sew faces together\n const sewOptions = new SewDto(hexagonFaces);\n sewOptions.tolerance = 1e-7;\n const sewedFaces = await shell.sewFaces(sewOptions);\n\n // Unify same domain for cleaner geometry\n const unifyOptions = new UnifySameDomainDto();\n unifyOptions.shape = sewedFaces;\n unifyOptions.unifyEdges = true;\n unifyOptions.unifyFaces = true;\n unifyOptions.concatBSplines = true;\n const unifiedShape = await shape.unifySameDomain(unifyOptions);\n\n // Extrude the unified shape\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = unifiedShape;\n extrudeOptions.direction = [0, 1, 0];\n const extrudedHive = await operations.extrude(extrudeOptions);\n\n // Draw the resulting flat hive structure\n bitbybit.draw.drawAnyAsync({\n entity: extrudedHive\n });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Hexagon hive" /> diff --git a/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-hive.md b/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-hive.md index 17eddda7..62b6f954 100644 --- a/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-hive.md +++ b/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-hive.md @@ -22,21 +22,21 @@ Moving beyond simple perforated patterns, three-dimensional hive structures crea widthheightnrHexWidthnrHexHeightwiresHexLargewiresHexSmallrandomHeightshexagons3DicompoundShapeForFastRenderingwidth10height20nrHexWidth10nrHexHeight20wiresHexLargewidthheightnrHexWidthnrHexHeightFALSEFALSEFALSEFALSEFALSEwiresHexSmallwidthheightnrHexWidthnrHexHeightFALSEFALSEFALSEFALSEFALSE0.80.8randomHeights12wiresHexLargehexagons3Di1wiresHexLarge1INSERTLASThexagons3DGETFROM_STARTwiresHexLargeiGETFROM_STARTwiresHexSmalliTRUE0GETFROM_STARTrandomHeightsi0compoundShapeForFastRenderinghexagons3DcompoundShapeForFastRendering","version":"0.20.14","type":"blockly"}} + script={{"script":"widthheightnrHexWidthnrHexHeightwiresHexLargewiresHexSmallrandomHeightshexagons3DicompoundShapeForFastRenderingwidth10height20nrHexWidth10nrHexHeight20wiresHexLargewidthheightnrHexWidthnrHexHeightFALSEFALSEFALSEFALSEFALSEwiresHexSmallwidthheightnrHexWidthnrHexHeightFALSEFALSEFALSEFALSEFALSE0.80.8randomHeights12wiresHexLargehexagons3Di1wiresHexLarge1INSERTLASThexagons3DGETFROM_STARTwiresHexLargeiGETFROM_STARTwiresHexSmalliTRUE0GETFROM_STARTrandomHeightsi0compoundShapeForFastRenderinghexagons3DcompoundShapeForFastRendering","version":"0.21.0","type":"blockly"}} title="Hexagon hive" /> {\n // Create hexagonal grid parameters\n const gridWidth = 10;\n const gridHeight = 20;\n const hexagonsInWidth = 10;\n const hexagonsInHeight = 20;\n\n // Generate large hexagonal wire grid (outer walls)\n const hexGridLargeOptions = new HexagonsInGridDto();\n hexGridLargeOptions.width = gridWidth;\n hexGridLargeOptions.height = gridHeight;\n hexGridLargeOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridLargeOptions.nrHexagonsInHeight = hexagonsInHeight;\n\n const wiresHexLarge = await wire.hexagonsInGrid(hexGridLargeOptions);\n\n // Generate small hexagonal wire grid (inner holes)\n const hexGridSmallOptions = new HexagonsInGridDto();\n hexGridSmallOptions.width = gridWidth;\n hexGridSmallOptions.height = gridHeight;\n hexGridSmallOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridSmallOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridSmallOptions.scalePatternWidth = [0.8];\n hexGridSmallOptions.scalePatternHeight = [0.8];\n\n const wiresHexSmall = await wire.hexagonsInGrid(hexGridSmallOptions);\n\n // Generate random heights for each hexagon cell\n const randomHeights = math.randomNumbers({\n low: 1,\n high: 2,\n count: wiresHexLarge.length\n });\n\n // Process each hexagon to create 3D cells with holes\n const hexagons3D: TopoDSSolidPointer[] = [];\n\n for (let i = 0; i < wiresHexLarge.length; i++) {\n // Get the outer and inner wires for this cell\n const outerWire = wiresHexLarge[i];\n const innerWire = wiresHexSmall[i];\n\n // Reverse the inner wire to create a hole\n const reverseOptions = new ShapeDto();\n reverseOptions.shape = innerWire;\n const reversedInnerWire = await wire.reversedWire(reverseOptions);\n\n // Create face with hole\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = [outerWire, reversedInnerWire];\n faceOptions.planar = true;\n const hexFaceWithHole = await face.createFaceFromWires(faceOptions);\n\n // Extrude the face with random height\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = hexFaceWithHole;\n extrudeOptions.direction = [0, randomHeights[i], 0];\n\n const extrudedCell = await operations.extrude(extrudeOptions);\n hexagons3D.push(extrudedCell);\n }\n\n // Combine all extruded cells into a compound shape for fast rendering\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = hexagons3D;\n const compoundShapeForFastRendering = await compound.makeCompound(compoundOptions);\n\n // Draw the resulting three-dimensional hive structure\n bitbybit.draw.drawAnyAsync({\n entity: compoundShapeForFastRendering\n });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs for hexagon grid creation and operations\nconst { HexagonsInGridDto, FaceFromWiresDto, ExtrudeDto, CompoundShapesDto, ShapeDto } = Bit.Inputs.OCCT;\n// Import type definitions for type safety\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSSolidPointer = Bit.Inputs.OCCT.TopoDSSolidPointer;\n\n// Get access to OCCT modules and utilities\nconst { wire, face, compound } = bitbybit.occt.shapes;\nconst { operations } = bitbybit.occt;\nconst { math } = bitbybit;\n\n// Define the main function to create a three-dimensional hexagon hive\nconst start = async () => {\n // Create hexagonal grid parameters\n const gridWidth = 10;\n const gridHeight = 20;\n const hexagonsInWidth = 10;\n const hexagonsInHeight = 20;\n\n // Generate large hexagonal wire grid (outer walls)\n const hexGridLargeOptions = new HexagonsInGridDto();\n hexGridLargeOptions.width = gridWidth;\n hexGridLargeOptions.height = gridHeight;\n hexGridLargeOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridLargeOptions.nrHexagonsInHeight = hexagonsInHeight;\n\n const wiresHexLarge = await wire.hexagonsInGrid(hexGridLargeOptions);\n\n // Generate small hexagonal wire grid (inner holes)\n const hexGridSmallOptions = new HexagonsInGridDto();\n hexGridSmallOptions.width = gridWidth;\n hexGridSmallOptions.height = gridHeight;\n hexGridSmallOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridSmallOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridSmallOptions.scalePatternWidth = [0.8];\n hexGridSmallOptions.scalePatternHeight = [0.8];\n\n const wiresHexSmall = await wire.hexagonsInGrid(hexGridSmallOptions);\n\n // Generate random heights for each hexagon cell\n const randomHeights = math.randomNumbers({\n low: 1,\n high: 2,\n count: wiresHexLarge.length\n });\n\n // Process each hexagon to create 3D cells with holes\n const hexagons3D: TopoDSSolidPointer[] = [];\n\n for (let i = 0; i < wiresHexLarge.length; i++) {\n // Get the outer and inner wires for this cell\n const outerWire = wiresHexLarge[i];\n const innerWire = wiresHexSmall[i];\n\n // Reverse the inner wire to create a hole\n const reverseOptions = new ShapeDto();\n reverseOptions.shape = innerWire;\n const reversedInnerWire = await wire.reversedWire(reverseOptions);\n\n // Create face with hole\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = [outerWire, reversedInnerWire];\n faceOptions.planar = true;\n const hexFaceWithHole = await face.createFaceFromWires(faceOptions);\n\n // Extrude the face with random height\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = hexFaceWithHole;\n extrudeOptions.direction = [0, randomHeights[i], 0];\n\n const extrudedCell = await operations.extrude(extrudeOptions);\n hexagons3D.push(extrudedCell);\n }\n\n // Combine all extruded cells into a compound shape for fast rendering\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = hexagons3D;\n const compoundShapeForFastRendering = await compound.makeCompound(compoundOptions);\n\n // Draw the resulting three-dimensional hive structure\n bitbybit.draw.drawAnyAsync({\n entity: compoundShapeForFastRendering\n });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Hexagon hive" /> diff --git a/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-holes-on-face.md b/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-holes-on-face.md index a60e6b6b..7277fa02 100644 --- a/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-holes-on-face.md +++ b/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-holes-on-face.md @@ -22,21 +22,21 @@ Hexagonal patterns are found throughout nature - from honeycomb structures to cr recFacefacesrecFace2014000010facesrecFace1010[0.9][0.9]FALSEFALSE0.010.01GETFIRSTfaces010","version":"0.20.14","type":"blockly"}} + script={{"script":"recFacefacesrecFace2014000010facesrecFace1010[0.9][0.9]FALSEFALSE0.010.01GETFIRSTfaces010","version":"0.21.0","type":"blockly"}} title="Hexagon holes on face" /> {\n // Create a rectangular face as the base shape\n const faceOptions = new RectangleDto();\n faceOptions.width = 20;\n faceOptions.length = 14;\n faceOptions.center = [0, 0, 0];\n faceOptions.direction = [0, 1, 0];\n const rectangleFace = await face.createRectangleFace(faceOptions);\n\n // Define scale patterns for U and V directions\n // For hexagons, uniform scaling often works best due to natural packing\n const scalePatternU = [0.9]; // Uniform hexagon size in U direction\n const scalePatternV = [0.9]; // Uniform hexagon size in V direction\n\n // Subdivide the face into hexagonal holes\n const subdivideOptions = new FaceSubdivideToHexagonHolesDto();\n subdivideOptions.shape = rectangleFace;\n subdivideOptions.nrHexagonsU = 10; // Number of hexagon divisions in U direction\n subdivideOptions.nrHexagonsV = 10; // Number of hexagon divisions in V direction\n subdivideOptions.flatU = false; // Pointy-top orientation (false) vs flat-top (true)\n subdivideOptions.holesToFaces = false; // Return wires instead of faces\n subdivideOptions.offsetFromBorderU = 0.01; // Small border offset in U direction\n subdivideOptions.offsetFromBorderV = 0.01; // Small border offset in V direction\n subdivideOptions.scalePatternU = scalePatternU;\n subdivideOptions.scalePatternV = scalePatternV;\n\n const holes = await face.subdivideToHexagonHoles(subdivideOptions);\n\n // Get the first hole (the outer boundary with hexagonal holes)\n const firstHole = lists.getItem({ list: holes, index: 0, clone: true });\n\n // Extrude the face with holes to create a 3D honeycomb structure\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = firstHole;\n extrudeOptions.direction = [0, 1, 0];\n const extrudedSolid = await operations.extrude(extrudeOptions);\n\n // Draw the resulting 3D solid with hexagonal holes\n bitbybit.draw.drawAnyAsync({\n entity: extrudedSolid\n });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs for face creation, subdivision, and extrusion\nconst { RectangleDto, FaceSubdivideToHexagonHolesDto, ExtrudeDto } = Bit.Inputs.OCCT;\n// Import type definitions for type safety\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\n\n// Get access to OCCT modules for face operations\nconst { face } = bitbybit.occt.shapes;\nconst { operations } = bitbybit.occt;\nconst { lists } = bitbybit;\n\n// Define the main function to create hexagon holes on a face\nconst start = async () => {\n // Create a rectangular face as the base shape\n const faceOptions = new RectangleDto();\n faceOptions.width = 20;\n faceOptions.length = 14;\n faceOptions.center = [0, 0, 0];\n faceOptions.direction = [0, 1, 0];\n const rectangleFace = await face.createRectangleFace(faceOptions);\n\n // Define scale patterns for U and V directions\n // For hexagons, uniform scaling often works best due to natural packing\n const scalePatternU = [0.9]; // Uniform hexagon size in U direction\n const scalePatternV = [0.9]; // Uniform hexagon size in V direction\n\n // Subdivide the face into hexagonal holes\n const subdivideOptions = new FaceSubdivideToHexagonHolesDto();\n subdivideOptions.shape = rectangleFace;\n subdivideOptions.nrHexagonsU = 10; // Number of hexagon divisions in U direction\n subdivideOptions.nrHexagonsV = 10; // Number of hexagon divisions in V direction\n subdivideOptions.flatU = false; // Pointy-top orientation (false) vs flat-top (true)\n subdivideOptions.holesToFaces = false; // Return wires instead of faces\n subdivideOptions.offsetFromBorderU = 0.01; // Small border offset in U direction\n subdivideOptions.offsetFromBorderV = 0.01; // Small border offset in V direction\n subdivideOptions.scalePatternU = scalePatternU;\n subdivideOptions.scalePatternV = scalePatternV;\n\n const holes = await face.subdivideToHexagonHoles(subdivideOptions);\n\n // Get the first hole (the outer boundary with hexagonal holes)\n const firstHole = lists.getItem({ list: holes, index: 0, clone: true });\n\n // Extrude the face with holes to create a 3D honeycomb structure\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = firstHole;\n extrudeOptions.direction = [0, 1, 0];\n const extrudedSolid = await operations.extrude(extrudeOptions);\n\n // Draw the resulting 3D solid with hexagonal holes\n bitbybit.draw.drawAnyAsync({\n entity: extrudedSolid\n });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Hexagon holes on face" /> diff --git a/docs/learn/code/common/occt/modeling/hollow-shapes/rectangle-holes-on-face.md b/docs/learn/code/common/occt/modeling/hollow-shapes/rectangle-holes-on-face.md index 3b4464a5..8788f06f 100644 --- a/docs/learn/code/common/occt/modeling/hollow-shapes/rectangle-holes-on-face.md +++ b/docs/learn/code/common/occt/modeling/hollow-shapes/rectangle-holes-on-face.md @@ -22,21 +22,21 @@ Creating regular patterns of holes manually can be time-consuming and error-pron recFacefacesrecFace2014000010facesrecFace1010[0.8,0.5,0.5][0.8,0.5,0.5]FALSE00GETFIRSTfaces010","version":"0.20.14","type":"blockly"}} + script={{"script":"recFacefacesrecFace2014000010facesrecFace1010[0.8,0.5,0.5][0.8,0.5,0.5]FALSE00GETFIRSTfaces010","version":"0.21.0","type":"blockly"}} title="Rectangle holes on face" /> {\n // Create a rectangular face as the base shape\n const faceOptions = new RectangleDto();\n faceOptions.width = 20;\n faceOptions.length = 14;\n faceOptions.center = [0, 0, 0];\n faceOptions.direction = [0, 1, 0];\n const rectangleFace = await face.createRectangleFace(faceOptions);\n\n // Define scale patterns for U and V directions\n // These arrays control the size of holes in each row and column\n const scalePatternU = [0.8, 0.5, 0.5]; // Varying hole sizes in U direction\n const scalePatternV = [0.8, 0.5, 0.5]; // Varying hole sizes in V direction\n\n // Subdivide the face into rectangular holes\n const subdivideOptions = new FaceSubdivideToRectangleHolesDto();\n subdivideOptions.shape = rectangleFace;\n subdivideOptions.nrRectanglesU = 10; // Number of divisions in U direction\n subdivideOptions.nrRectanglesV = 10; // Number of divisions in V direction\n subdivideOptions.holesToFaces = false; // Return wires instead of faces\n subdivideOptions.offsetFromBorderU = 0.05; // Border offset in U direction\n subdivideOptions.offsetFromBorderV = 0.05; // Border offset in V direction\n subdivideOptions.scalePatternU = scalePatternU;\n subdivideOptions.scalePatternV = scalePatternV;\n\n const holes = await face.subdivideToRectangleHoles(subdivideOptions);\n\n // Get the first hole (the outer boundary with holes)\n const firstHole = lists.getItem({ list: holes, index: 0, clone: true });\n\n // Extrude the face with holes to create a 3D solid\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = firstHole;\n extrudeOptions.direction = [0, 1, 0];\n const extrudedSolid = await operations.extrude(extrudeOptions);\n\n // Draw the resulting 3D solid with rectangular holes\n bitbybit.draw.drawAnyAsync({\n entity: extrudedSolid\n });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs for face creation, subdivision, and extrusion\nconst { RectangleDto, FaceSubdivideToRectangleHolesDto, ExtrudeDto } = Bit.Inputs.OCCT;\n// Import type definitions for type safety\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\n\n// Get access to OCCT modules for face operations\nconst { face } = bitbybit.occt.shapes;\nconst { operations } = bitbybit.occt;\nconst { lists } = bitbybit;\n\n// Define the main function to create rectangle holes on a face\nconst start = async () => {\n // Create a rectangular face as the base shape\n const faceOptions = new RectangleDto();\n faceOptions.width = 20;\n faceOptions.length = 14;\n faceOptions.center = [0, 0, 0];\n faceOptions.direction = [0, 1, 0];\n const rectangleFace = await face.createRectangleFace(faceOptions);\n\n // Define scale patterns for U and V directions\n // These arrays control the size of holes in each row and column\n const scalePatternU = [0.8, 0.5, 0.5]; // Varying hole sizes in U direction\n const scalePatternV = [0.8, 0.5, 0.5]; // Varying hole sizes in V direction\n\n // Subdivide the face into rectangular holes\n const subdivideOptions = new FaceSubdivideToRectangleHolesDto();\n subdivideOptions.shape = rectangleFace;\n subdivideOptions.nrRectanglesU = 10; // Number of divisions in U direction\n subdivideOptions.nrRectanglesV = 10; // Number of divisions in V direction\n subdivideOptions.holesToFaces = false; // Return wires instead of faces\n subdivideOptions.offsetFromBorderU = 0.05; // Border offset in U direction\n subdivideOptions.offsetFromBorderV = 0.05; // Border offset in V direction\n subdivideOptions.scalePatternU = scalePatternU;\n subdivideOptions.scalePatternV = scalePatternV;\n\n const holes = await face.subdivideToRectangleHoles(subdivideOptions);\n\n // Get the first hole (the outer boundary with holes)\n const firstHole = lists.getItem({ list: holes, index: 0, clone: true });\n\n // Extrude the face with holes to create a 3D solid\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = firstHole;\n extrudeOptions.direction = [0, 1, 0];\n const extrudedSolid = await operations.extrude(extrudeOptions);\n\n // Draw the resulting 3D solid with rectangular holes\n bitbybit.draw.drawAnyAsync({\n entity: extrudedSolid\n });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Rectangle holes on face" /> diff --git a/docs/learn/code/common/occt/modeling/hollow-shapes/simple-hole.md b/docs/learn/code/common/occt/modeling/hollow-shapes/simple-hole.md index 134e37aa..cfc75d46 100644 --- a/docs/learn/code/common/occt/modeling/hollow-shapes/simple-hole.md +++ b/docs/learn/code/common/occt/modeling/hollow-shapes/simple-hole.md @@ -30,21 +30,21 @@ This technique is fundamental because it establishes the basic principle that ap 200000107000010TRUE","version":"0.20.14","type":"blockly"}} + script={{"script":"200000107000010TRUE","version":"0.21.0","type":"blockly"}} title="Simple hole from two wires" /> {\n // Create the outer square wire (boundary of the shape)\n const outerWireOptions = new SquareDto();\n outerWireOptions.size = 20;\n outerWireOptions.center = [0, 0, 0];\n outerWireOptions.direction = [0, 1, 0];\n const outerWire = await wire.createSquareWire(outerWireOptions);\n\n // Create the inner square wire (defines the hole)\n const innerWireOptions = new SquareDto();\n innerWireOptions.size = 7;\n innerWireOptions.center = [0, 0, 0];\n innerWireOptions.direction = [0, 1, 0];\n const innerWire = await wire.createSquareWire(innerWireOptions);\n\n // Reverse the inner wire - this is crucial for proper hole creation\n const reversedInnerWire = await wire.reversedWire({ shape: innerWire });\n\n // Create a face from both wires - outer boundary and inner hole\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = [outerWire, reversedInnerWire];\n faceOptions.planar = true;\n const faceWithHole = await face.createFaceFromWires(faceOptions);\n\n // Draw the resulting face with hole\n bitbybit.draw.drawAnyAsync({\n entity: faceWithHole\n });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required types and DTOs for creating wire shapes and faces\nconst { SquareDto, FaceFromWiresDto } = Bit.Inputs.OCCT;\n// Import the wire pointer type for type safety\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\n\n// Get direct access to OCCT wire and face creation functions\nconst { wire } = bitbybit.occt.shapes;\nconst { face } = bitbybit.occt.shapes;\n\n// Define the main function to create a simple hole\nconst start = async () => {\n // Create the outer square wire (boundary of the shape)\n const outerWireOptions = new SquareDto();\n outerWireOptions.size = 20;\n outerWireOptions.center = [0, 0, 0];\n outerWireOptions.direction = [0, 1, 0];\n const outerWire = await wire.createSquareWire(outerWireOptions);\n\n // Create the inner square wire (defines the hole)\n const innerWireOptions = new SquareDto();\n innerWireOptions.size = 7;\n innerWireOptions.center = [0, 0, 0];\n innerWireOptions.direction = [0, 1, 0];\n const innerWire = await wire.createSquareWire(innerWireOptions);\n\n // Reverse the inner wire - this is crucial for proper hole creation\n const reversedInnerWire = await wire.reversedWire({ shape: innerWire });\n\n // Create a face from both wires - outer boundary and inner hole\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = [outerWire, reversedInnerWire];\n faceOptions.planar = true;\n const faceWithHole = await face.createFaceFromWires(faceOptions);\n\n // Draw the resulting face with hole\n bitbybit.draw.drawAnyAsync({\n entity: faceWithHole\n });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Simple hole from two wires" /> @@ -60,21 +60,21 @@ The transition from a 2D hollow face to a 3D hollow solid is achieved through ex 2014000010177000010101045TRUE020","version":"0.20.14","type":"blockly"}} + script={{"script":"2014000010177000010101045TRUE020","version":"0.21.0","type":"blockly"}} title="More complex solid with the hole" /> {\n // Create the outer rectangular wire\n const outerWireOptions = new RectangleDto();\n outerWireOptions.width = 20;\n outerWireOptions.length = 14;\n outerWireOptions.center = [0, 0, 0];\n outerWireOptions.direction = [0, 1, 0];\n const outerWire = await wire.createRectangleWire(outerWireOptions);\n\n // Apply fillet to the outer wire for rounded corners\n const outerFilletOptions = new FilletDto();\n outerFilletOptions.radius = 1;\n outerFilletOptions.shape = outerWire;\n const filletedOuterWire = await fillets.fillet2d(outerFilletOptions);\n\n // Create the inner rectangular wire (hole)\n const innerWireOptions = new RectangleDto();\n innerWireOptions.width = 7;\n innerWireOptions.length = 7;\n innerWireOptions.center = [0, 0, 0];\n innerWireOptions.direction = [0, 1, 0];\n const innerWire = await wire.createRectangleWire(innerWireOptions);\n\n // Apply fillet to the inner wire\n const innerFilletOptions = new FilletDto();\n innerFilletOptions.radius = 1;\n innerFilletOptions.shape = innerWire;\n const filletedInnerWire = await fillets.fillet2d(innerFilletOptions);\n\n // Rotate the inner wire by 45 degrees for visual interest\n const rotatedInnerWire = await transforms.rotate({\n shape: filletedInnerWire,\n axis: [0, 1, 0],\n angle: 45\n });\n\n // Reverse the rotated inner wire for proper hole creation\n const reversedInnerWire = await wire.reversedWire({ shape: rotatedInnerWire });\n\n // Create a face from both wires\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = [filletedOuterWire, reversedInnerWire];\n faceOptions.planar = true;\n const faceWithHole = await face.createFaceFromWires(faceOptions);\n\n // Extrude the face to create a 3D solid\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = faceWithHole;\n extrudeOptions.direction = [0, 2, 0]; // Extrude 2 units in Y direction\n const solidWithHole = await operations.extrude(extrudeOptions);\n\n // Draw the resulting 3D solid with hole\n bitbybit.draw.drawAnyAsync({\n entity: solidWithHole\n });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs for creating wires, fillets, faces, and extrusion operations\nconst { RectangleDto, FilletDto, FaceFromWiresDto, ExtrudeDto } = Bit.Inputs.OCCT;\n// Import wire pointer type for type safety\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\n\n// Get access to OCCT modules for creating shapes and operations\nconst { wire, face } = bitbybit.occt.shapes;\nconst { fillets, operations, transforms } = bitbybit.occt;\n\n// Define the main function to create an extruded solid with a hole\nconst start = async () => {\n // Create the outer rectangular wire\n const outerWireOptions = new RectangleDto();\n outerWireOptions.width = 20;\n outerWireOptions.length = 14;\n outerWireOptions.center = [0, 0, 0];\n outerWireOptions.direction = [0, 1, 0];\n const outerWire = await wire.createRectangleWire(outerWireOptions);\n\n // Apply fillet to the outer wire for rounded corners\n const outerFilletOptions = new FilletDto();\n outerFilletOptions.radius = 1;\n outerFilletOptions.shape = outerWire;\n const filletedOuterWire = await fillets.fillet2d(outerFilletOptions);\n\n // Create the inner rectangular wire (hole)\n const innerWireOptions = new RectangleDto();\n innerWireOptions.width = 7;\n innerWireOptions.length = 7;\n innerWireOptions.center = [0, 0, 0];\n innerWireOptions.direction = [0, 1, 0];\n const innerWire = await wire.createRectangleWire(innerWireOptions);\n\n // Apply fillet to the inner wire\n const innerFilletOptions = new FilletDto();\n innerFilletOptions.radius = 1;\n innerFilletOptions.shape = innerWire;\n const filletedInnerWire = await fillets.fillet2d(innerFilletOptions);\n\n // Rotate the inner wire by 45 degrees for visual interest\n const rotatedInnerWire = await transforms.rotate({\n shape: filletedInnerWire,\n axis: [0, 1, 0],\n angle: 45\n });\n\n // Reverse the rotated inner wire for proper hole creation\n const reversedInnerWire = await wire.reversedWire({ shape: rotatedInnerWire });\n\n // Create a face from both wires\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = [filletedOuterWire, reversedInnerWire];\n faceOptions.planar = true;\n const faceWithHole = await face.createFaceFromWires(faceOptions);\n\n // Extrude the face to create a 3D solid\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = faceWithHole;\n extrudeOptions.direction = [0, 2, 0]; // Extrude 2 units in Y direction\n const solidWithHole = await operations.extrude(extrudeOptions);\n\n // Draw the resulting 3D solid with hole\n bitbybit.draw.drawAnyAsync({\n entity: solidWithHole\n });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="More complex solid with the hole" /> @@ -90,21 +90,21 @@ The process simply involves creating additional inner wires and including them a 231400001017700001010104550077000010101045-500TRUE020","version":"0.20.14","type":"blockly"}} + script={{"script":"231400001017700001010104550077000010101045-500TRUE020","version":"0.21.0","type":"blockly"}} title="Solid with 2 holes" /> {\n // Create the outer rectangular wire (larger this time)\n const outerWireOptions = new RectangleDto();\n outerWireOptions.width = 23;\n outerWireOptions.length = 14;\n outerWireOptions.center = [0, 0, 0];\n outerWireOptions.direction = [0, 1, 0];\n const outerWire = await wire.createRectangleWire(outerWireOptions);\n\n // Apply fillet to the outer wire\n const outerFilletOptions = new FilletDto();\n outerFilletOptions.radius = 1;\n outerFilletOptions.shape = outerWire;\n const filletedOuterWire = await fillets.fillet2d(outerFilletOptions);\n\n // Reverse the outer wire (optimization - reverse once instead of multiple inner wires)\n const reversedOuterWire = await wire.reversedWire({ shape: filletedOuterWire });\n\n // Create the base inner rectangular wire\n const innerWireOptions = new RectangleDto();\n innerWireOptions.width = 7;\n innerWireOptions.length = 7;\n innerWireOptions.center = [0, 0, 0];\n innerWireOptions.direction = [0, 1, 0];\n const innerWire = await wire.createRectangleWire(innerWireOptions);\n\n // Apply fillet to the inner wire\n const innerFilletOptions = new FilletDto();\n innerFilletOptions.radius = 1;\n innerFilletOptions.shape = innerWire;\n const filletedInnerWire = await fillets.fillet2d(innerFilletOptions);\n\n // Rotate the inner wire for visual interest\n const rotatedInnerWire = await transforms.rotate({\n shape: filletedInnerWire,\n axis: [0, 1, 0],\n angle: 45\n });\n\n // Create first hole by translating the rotated wire to the right\n const firstHole = await transforms.translate({\n shape: rotatedInnerWire,\n translation: [5, 0, 0]\n });\n\n // Create second hole by translating the rotated wire to the left\n const secondHole = await transforms.translate({\n shape: rotatedInnerWire,\n translation: [-5, 0, 0]\n });\n\n // Create a face from the outer boundary and multiple holes\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = [reversedOuterWire, firstHole, secondHole];\n faceOptions.planar = true;\n const faceWithHoles = await face.createFaceFromWires(faceOptions);\n\n // Extrude the face to create a 3D solid with multiple holes\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = faceWithHoles;\n extrudeOptions.direction = [0, 2, 0];\n const solidWithHoles = await operations.extrude(extrudeOptions);\n\n // Draw the resulting 3D solid with multiple holes\n bitbybit.draw.drawAnyAsync({\n entity: solidWithHoles\n });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs for creating complex shapes with multiple holes\nconst { RectangleDto, FilletDto, FaceFromWiresDto, ExtrudeDto } = Bit.Inputs.OCCT;\n// Import type definitions for type safety\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\n\n// Get access to OCCT modules\nconst { wire, face } = bitbybit.occt.shapes;\nconst { fillets, operations, transforms } = bitbybit.occt;\n\n// Define the main function to create a solid with multiple holes\nconst start = async () => {\n // Create the outer rectangular wire (larger this time)\n const outerWireOptions = new RectangleDto();\n outerWireOptions.width = 23;\n outerWireOptions.length = 14;\n outerWireOptions.center = [0, 0, 0];\n outerWireOptions.direction = [0, 1, 0];\n const outerWire = await wire.createRectangleWire(outerWireOptions);\n\n // Apply fillet to the outer wire\n const outerFilletOptions = new FilletDto();\n outerFilletOptions.radius = 1;\n outerFilletOptions.shape = outerWire;\n const filletedOuterWire = await fillets.fillet2d(outerFilletOptions);\n\n // Reverse the outer wire (optimization - reverse once instead of multiple inner wires)\n const reversedOuterWire = await wire.reversedWire({ shape: filletedOuterWire });\n\n // Create the base inner rectangular wire\n const innerWireOptions = new RectangleDto();\n innerWireOptions.width = 7;\n innerWireOptions.length = 7;\n innerWireOptions.center = [0, 0, 0];\n innerWireOptions.direction = [0, 1, 0];\n const innerWire = await wire.createRectangleWire(innerWireOptions);\n\n // Apply fillet to the inner wire\n const innerFilletOptions = new FilletDto();\n innerFilletOptions.radius = 1;\n innerFilletOptions.shape = innerWire;\n const filletedInnerWire = await fillets.fillet2d(innerFilletOptions);\n\n // Rotate the inner wire for visual interest\n const rotatedInnerWire = await transforms.rotate({\n shape: filletedInnerWire,\n axis: [0, 1, 0],\n angle: 45\n });\n\n // Create first hole by translating the rotated wire to the right\n const firstHole = await transforms.translate({\n shape: rotatedInnerWire,\n translation: [5, 0, 0]\n });\n\n // Create second hole by translating the rotated wire to the left\n const secondHole = await transforms.translate({\n shape: rotatedInnerWire,\n translation: [-5, 0, 0]\n });\n\n // Create a face from the outer boundary and multiple holes\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = [reversedOuterWire, firstHole, secondHole];\n faceOptions.planar = true;\n const faceWithHoles = await face.createFaceFromWires(faceOptions);\n\n // Extrude the face to create a 3D solid with multiple holes\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = faceWithHoles;\n extrudeOptions.direction = [0, 2, 0];\n const solidWithHoles = await operations.extrude(extrudeOptions);\n\n // Draw the resulting 3D solid with multiple holes\n bitbybit.draw.drawAnyAsync({\n entity: solidWithHoles\n });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Solid with 2 holes" /> diff --git a/docs/learn/code/common/occt/modeling/hollow-shapes/simple-hollow-grids.md b/docs/learn/code/common/occt/modeling/hollow-shapes/simple-hollow-grids.md index 332755a6..ab2aead8 100644 --- a/docs/learn/code/common/occt/modeling/hollow-shapes/simple-hollow-grids.md +++ b/docs/learn/code/common/occt/modeling/hollow-shapes/simple-hollow-grids.md @@ -30,21 +30,21 @@ This approach not only saves time but also ensures perfect regularity and makes gridSizeholeRadiusholeSpacingextrudeHeighthalfGridboundarySizesquarexPositionsyPositionswiresxzhollowFacehollowGridSolidgridSize14holeRadius0.8holeSpacing2extrudeHeight0.5halfGridDIVIDEgridSize2boundarySizeADDgridSize4squareboundarySize000010xPositionsholeSpacingNEGhalfGridhalfGridyPositionsholeSpacingNEGhalfGridhalfGridwiressquarex1xPositions1z1xPositions1INSERTLASTwiresholeRadiusGETFROM_STARTxPositionsx0GETFROM_STARTyPositionsz010hollowFacewiresTRUEhollowGridSolidhollowFace0extrudeHeight0hollowGridSolid","version":"0.20.14","type":"blockly"}} + script={{"script":"gridSizeholeRadiusholeSpacingextrudeHeighthalfGridboundarySizesquarexPositionsyPositionswiresxzhollowFacehollowGridSolidgridSize14holeRadius0.8holeSpacing2extrudeHeight0.5halfGridDIVIDEgridSize2boundarySizeADDgridSize4squareboundarySize000010xPositionsholeSpacingNEGhalfGridhalfGridyPositionsholeSpacingNEGhalfGridhalfGridwiressquarex1xPositions1z1xPositions1INSERTLASTwiresholeRadiusGETFROM_STARTxPositionsx0GETFROM_STARTyPositionsz010hollowFacewiresTRUEhollowGridSolidhollowFace0extrudeHeight0hollowGridSolid","version":"0.21.0","type":"blockly"}} title="Simple hollow grid" /> {\n // Grid parameters - easily adjustable for different requirements\n const gridSize = 14; // Overall grid dimension\n const holeRadius = 0.8; // Radius of each circular hole\n const holeSpacing = 2; // Distance between hole centers\n const extrudeHeight = 0.5; // Thickness of the final solid\n \n // Calculate grid boundaries\n const halfGrid = gridSize / 2;\n const boundarySize = gridSize + 4; // Add padding around holes\n \n // Create the outer boundary wire (square frame)\n const boundaryOptions = new SquareDto();\n boundaryOptions.size = boundarySize;\n boundaryOptions.center = [0, 0, 0];\n boundaryOptions.direction = [0, 1, 0];\n const boundaryWire = await wire.createSquareWire(boundaryOptions);\n \n // Generate grid positions using span functions\n const xPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: holeSpacing\n });\n \n const zPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: holeSpacing\n });\n \n // Create grid points by combining X and Z coordinates\n const gridPoints: Point3[] = [];\n for (const xPos of xPositions) {\n for (const zPos of zPositions) {\n gridPoints.push([xPos, 0, zPos]);\n }\n }\n \n // Create the hole template (circular wire)\n const holeOptions = new CircleDto();\n holeOptions.radius = holeRadius;\n holeOptions.center = [0, 0, 0];\n holeOptions.direction = [0, 1, 0];\n const holeTemplate = await wire.createCircleWire(holeOptions);\n \n // Create holes at each grid position\n const holes: TopoDSWirePointer[] = [];\n for (const position of gridPoints) {\n const translatedHole = await transforms.translate({\n shape: holeTemplate,\n translation: position\n });\n \n // Reverse each hole wire for proper orientation\n const reversedHole = await wire.reversedWire({ shape: translatedHole });\n holes.push(reversedHole);\n }\n \n // Combine boundary and all holes into a single wire list\n const allWires = [boundaryWire, ...holes];\n \n // Create a face from the boundary and all holes\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = allWires;\n faceOptions.planar = true;\n const gridFace = await face.createFaceFromWires(faceOptions);\n \n // Extrude the face to create a 3D hollow grid\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = gridFace;\n extrudeOptions.direction = [0, extrudeHeight, 0];\n const hollowGrid = await operations.extrude(extrudeOptions);\n \n // Draw the resulting hollow grid\n bitbybit.draw.drawAnyAsync({\n entity: hollowGrid\n });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs for creating grids, shapes, and operations\nconst { SquareDto, CircleDto, FaceFromWiresDto, ExtrudeDto } = Bit.Inputs.OCCT;\n// Import type definitions for type safety\ntype Point3 = Bit.Inputs.Base.Point3;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\n\n// Get access to OCCT modules and utility functions\nconst { wire, face } = bitbybit.occt.shapes;\nconst { operations, transforms } = bitbybit.occt;\nconst { vector } = bitbybit;\n\n// Define the main function to create a parametric hollow grid\nconst start = async () => {\n // Grid parameters - easily adjustable for different requirements\n const gridSize = 14; // Overall grid dimension\n const holeRadius = 0.8; // Radius of each circular hole\n const holeSpacing = 2; // Distance between hole centers\n const extrudeHeight = 0.5; // Thickness of the final solid\n \n // Calculate grid boundaries\n const halfGrid = gridSize / 2;\n const boundarySize = gridSize + 4; // Add padding around holes\n \n // Create the outer boundary wire (square frame)\n const boundaryOptions = new SquareDto();\n boundaryOptions.size = boundarySize;\n boundaryOptions.center = [0, 0, 0];\n boundaryOptions.direction = [0, 1, 0];\n const boundaryWire = await wire.createSquareWire(boundaryOptions);\n \n // Generate grid positions using span functions\n const xPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: holeSpacing\n });\n \n const zPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: holeSpacing\n });\n \n // Create grid points by combining X and Z coordinates\n const gridPoints: Point3[] = [];\n for (const xPos of xPositions) {\n for (const zPos of zPositions) {\n gridPoints.push([xPos, 0, zPos]);\n }\n }\n \n // Create the hole template (circular wire)\n const holeOptions = new CircleDto();\n holeOptions.radius = holeRadius;\n holeOptions.center = [0, 0, 0];\n holeOptions.direction = [0, 1, 0];\n const holeTemplate = await wire.createCircleWire(holeOptions);\n \n // Create holes at each grid position\n const holes: TopoDSWirePointer[] = [];\n for (const position of gridPoints) {\n const translatedHole = await transforms.translate({\n shape: holeTemplate,\n translation: position\n });\n \n // Reverse each hole wire for proper orientation\n const reversedHole = await wire.reversedWire({ shape: translatedHole });\n holes.push(reversedHole);\n }\n \n // Combine boundary and all holes into a single wire list\n const allWires = [boundaryWire, ...holes];\n \n // Create a face from the boundary and all holes\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = allWires;\n faceOptions.planar = true;\n const gridFace = await face.createFaceFromWires(faceOptions);\n \n // Extrude the face to create a 3D hollow grid\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = gridFace;\n extrudeOptions.direction = [0, extrudeHeight, 0];\n const hollowGrid = await operations.extrude(extrudeOptions);\n \n // Draw the resulting hollow grid\n bitbybit.draw.drawAnyAsync({\n entity: hollowGrid\n });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Simple hollow grid" /> diff --git a/docs/learn/code/common/occt/modeling/parametric-art/simple-flower.md b/docs/learn/code/common/occt/modeling/parametric-art/simple-flower.md index da3323c7..acaee7cb 100644 --- a/docs/learn/code/common/occt/modeling/parametric-art/simple-flower.md +++ b/docs/learn/code/common/occt/modeling/parametric-art/simple-flower.md @@ -30,21 +30,21 @@ This method is highly parametric—by adjusting the control points, rotation ang controlPointscurvemirrorNormalmirroredCurvecombinedWiresflowerFacethickFlowerrotationAxisrotationAnglesflowerPetalsanglerotatedPetalfinalFlowercontrolPoints00020.531.1-0.570010curvecontrolPointsFALSE1e-7mirrorNormal100mirroredCurvecurve000mirrorNormalcombinedWirescurvemirroredCurveflowerFacecombinedWiresFALSEthickFlowerflowerFace0.1rotationAxis220rotationAngles300360flowerPetalsangle1rotationAngles1rotatedPetalthickFlowerrotationAxisGETFROM_STARTrotationAnglesangleINSERTLASTflowerPetalsrotatedPetalfinalFlowerflowerPetalsfinalFlower0.01Custom Material#14ffa5#0000000.60.51FALSE2TRUE#0000002-100-100-1003#ffffff#ffffff1024TRUE0TRUE0.20.00010.00210000#090a0b#a4f9ef'to top'0100","version":"0.20.14","type":"blockly"}} + script={{"script":"controlPointscurvemirrorNormalmirroredCurvecombinedWiresflowerFacethickFlowerrotationAxisrotationAnglesflowerPetalsanglerotatedPetalfinalFlowercontrolPoints00020.531.1-0.570010curvecontrolPointsFALSE1e-7mirrorNormal100mirroredCurvecurve000mirrorNormalcombinedWirescurvemirroredCurveflowerFacecombinedWiresFALSEthickFlowerflowerFace0.1rotationAxis220rotationAngles300360flowerPetalsangle1rotationAngles1rotatedPetalthickFlowerrotationAxisGETFROM_STARTrotationAnglesangleINSERTLASTflowerPetalsrotatedPetalfinalFlowerflowerPetalsfinalFlower0.01Custom Material#14ffa5#0000000.60.51FALSE2TRUE#0000002-100-100-1003#ffffff#ffffff1024TRUE0TRUE0.20.00010.00210000#090a0b#a4f9ef'to top'0100","version":"0.21.0","type":"blockly"}} title="Simple flower" /> {\n const backgroundOpt = new SceneTwoColorLinearGradientDto();\n backgroundOpt.colorFrom = \"#090a0b\";\n backgroundOpt.colorTo = \"#a4f9ef\";\n backgroundOpt.direction = gradientDirectionEnum.toTop;\n scene.twoColorLinearGradient(backgroundOpt);\n\n const dirLightOpt = new DirectionalLightDto();\n dirLightOpt.intensity = 3;\n scene.drawDirectionalLight(dirLightOpt);\n}\n\n// Define the main function to create a parametric flower\nconst start = async () => {\n createEnvironment();\n // Flower parameters - easily adjustable for different designs\n const thickness = 0.1; // Thickness of the flower petals\n const rotationStep = 30; // Degrees between each petal (12 petals total)\n const rotationAxis: Vector3 = [2, 2, 0]; // Axis for petal rotation\n\n // Define control points for the flower petal curve\n const controlPoints: Point3[] = [\n [0, 0, 0], // Start point (flower center)\n [2, 0.5, 3], // First control point (petal width)\n [1.1, -0.5, 7], // Second control point (petal curve)\n [0, 0, 10] // End point (petal tip)\n ];\n\n // Create interpolated curve through control points\n const curveOptions = new InterpolationDto();\n curveOptions.points = controlPoints;\n curveOptions.periodic = false;\n curveOptions.tolerance = 1e-7;\n const petalCurve = await wire.interpolatePoints(curveOptions);\n\n // Mirror the curve to create symmetry for the petal\n const mirrorOptions = new MirrorAlongNormalDto();\n mirrorOptions.shape = petalCurve;\n mirrorOptions.origin = [0, 0, 0];\n mirrorOptions.normal = [1, 0, 0]; // Mirror along X-axis\n const mirroredCurve = await transforms.mirrorAlongNormal(mirrorOptions);\n\n // Combine the original and mirrored curves into a single wire\n const combineOptions = new ShapesDto();\n combineOptions.shapes = [petalCurve, mirroredCurve];\n const combinedWire = await wire.combineEdgesAndWiresIntoAWire(combineOptions);\n\n // Create a face from the combined wire\n const faceOptions = new FaceFromWireDto();\n faceOptions.shape = combinedWire;\n faceOptions.planar = false; // Allow non-planar surface\n const petalFace = await face.createFaceFromWire(faceOptions);\n\n // Create a thick solid from the face\n const thickOptions = new ThisckSolidSimpleDto();\n thickOptions.shape = petalFace;\n thickOptions.offset = thickness;\n const thickPetal = await operations.makeThickSolidSimple(thickOptions);\n\n // Generate rotation angles for petals (0° to 360° in steps)\n const rotationAngles = vector.span({\n min: 0,\n max: 360,\n step: rotationStep\n });\n\n // Create all flower petals by rotating the base petal\n const flowerPetalPromises: Promise[] = [];\n for (const angle of rotationAngles) {\n const rotateOptions = new RotateDto();\n rotateOptions.shape = thickPetal;\n rotateOptions.axis = rotationAxis;\n rotateOptions.angle = angle;\n\n const rotatedPetal = transforms.rotate(rotateOptions);\n flowerPetalPromises.push(rotatedPetal);\n }\n\n const flowerPetals = await Promise.all(flowerPetalPromises);\n\n // Combine all petals into a single compound shape\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = flowerPetals;\n const flower = await compound.makeCompound(compoundOptions);\n\n const pbrOptions = new Bit.Inputs.BabylonMaterial.PBRMetallicRoughnessDto();\n pbrOptions.baseColor = \"#14ffa5\";\n pbrOptions.metallic = 0.6;\n pbrOptions.roughness = 0.6;\n pbrOptions.zOffset = 2;\n const pbrMaterial = pbrMetallicRoughness.create(pbrOptions);\n\n const drawOpt = new Bit.Inputs.Draw.DrawOcctShapeMaterialOptions();\n drawOpt.faceMaterial = pbrMaterial;\n drawOpt.edgeColour = \"#000000\";\n\n // Draw the completed flower with material options\n bitbybit.draw.drawAnyAsync({\n entity: flower,\n options: drawOpt\n });\n}\n\n// Execute the flower creation function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs for creating curves, shapes, and operations\nconst { InterpolationDto, MirrorAlongNormalDto, ShapesDto, CompoundShapesDto,\n FaceFromWireDto, ThisckSolidSimpleDto, RotateDto } = Bit.Inputs.OCCT;\nconst { SceneTwoColorLinearGradientDto, DirectionalLightDto } = Bit.Inputs.BabylonScene;\nconst { gradientDirectionEnum } = Bit.Inputs.Base;\n\n// Import type definitions for type safety\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer;\n\n// Get access to OCCT modules and utility functions\nconst { wire, face, compound } = bitbybit.occt.shapes;\nconst { operations, transforms } = bitbybit.occt;\nconst { vector } = bitbybit;\nconst { scene } = bitbybit.babylon;\nconst { pbrMetallicRoughness } = bitbybit.babylon.material;\n\n\nconst createEnvironment = async () => {\n const backgroundOpt = new SceneTwoColorLinearGradientDto();\n backgroundOpt.colorFrom = \"#090a0b\";\n backgroundOpt.colorTo = \"#a4f9ef\";\n backgroundOpt.direction = gradientDirectionEnum.toTop;\n scene.twoColorLinearGradient(backgroundOpt);\n\n const dirLightOpt = new DirectionalLightDto();\n dirLightOpt.intensity = 3;\n scene.drawDirectionalLight(dirLightOpt);\n}\n\n// Define the main function to create a parametric flower\nconst start = async () => {\n createEnvironment();\n // Flower parameters - easily adjustable for different designs\n const thickness = 0.1; // Thickness of the flower petals\n const rotationStep = 30; // Degrees between each petal (12 petals total)\n const rotationAxis: Vector3 = [2, 2, 0]; // Axis for petal rotation\n\n // Define control points for the flower petal curve\n const controlPoints: Point3[] = [\n [0, 0, 0], // Start point (flower center)\n [2, 0.5, 3], // First control point (petal width)\n [1.1, -0.5, 7], // Second control point (petal curve)\n [0, 0, 10] // End point (petal tip)\n ];\n\n // Create interpolated curve through control points\n const curveOptions = new InterpolationDto();\n curveOptions.points = controlPoints;\n curveOptions.periodic = false;\n curveOptions.tolerance = 1e-7;\n const petalCurve = await wire.interpolatePoints(curveOptions);\n\n // Mirror the curve to create symmetry for the petal\n const mirrorOptions = new MirrorAlongNormalDto();\n mirrorOptions.shape = petalCurve;\n mirrorOptions.origin = [0, 0, 0];\n mirrorOptions.normal = [1, 0, 0]; // Mirror along X-axis\n const mirroredCurve = await transforms.mirrorAlongNormal(mirrorOptions);\n\n // Combine the original and mirrored curves into a single wire\n const combineOptions = new ShapesDto();\n combineOptions.shapes = [petalCurve, mirroredCurve];\n const combinedWire = await wire.combineEdgesAndWiresIntoAWire(combineOptions);\n\n // Create a face from the combined wire\n const faceOptions = new FaceFromWireDto();\n faceOptions.shape = combinedWire;\n faceOptions.planar = false; // Allow non-planar surface\n const petalFace = await face.createFaceFromWire(faceOptions);\n\n // Create a thick solid from the face\n const thickOptions = new ThisckSolidSimpleDto();\n thickOptions.shape = petalFace;\n thickOptions.offset = thickness;\n const thickPetal = await operations.makeThickSolidSimple(thickOptions);\n\n // Generate rotation angles for petals (0° to 360° in steps)\n const rotationAngles = vector.span({\n min: 0,\n max: 360,\n step: rotationStep\n });\n\n // Create all flower petals by rotating the base petal\n const flowerPetalPromises: Promise[] = [];\n for (const angle of rotationAngles) {\n const rotateOptions = new RotateDto();\n rotateOptions.shape = thickPetal;\n rotateOptions.axis = rotationAxis;\n rotateOptions.angle = angle;\n\n const rotatedPetal = transforms.rotate(rotateOptions);\n flowerPetalPromises.push(rotatedPetal);\n }\n\n const flowerPetals = await Promise.all(flowerPetalPromises);\n\n // Combine all petals into a single compound shape\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = flowerPetals;\n const flower = await compound.makeCompound(compoundOptions);\n\n const pbrOptions = new Bit.Inputs.BabylonMaterial.PBRMetallicRoughnessDto();\n pbrOptions.baseColor = \"#14ffa5\";\n pbrOptions.metallic = 0.6;\n pbrOptions.roughness = 0.6;\n pbrOptions.zOffset = 2;\n const pbrMaterial = pbrMetallicRoughness.create(pbrOptions);\n\n const drawOpt = new Bit.Inputs.Draw.DrawOcctShapeMaterialOptions();\n drawOpt.faceMaterial = pbrMaterial;\n drawOpt.edgeColour = \"#000000\";\n\n // Draw the completed flower with material options\n bitbybit.draw.drawAnyAsync({\n entity: flower,\n options: drawOpt\n });\n}\n\n// Execute the flower creation function\nstart();","version":"0.21.0","type":"typescript"}} title="Simple flower" /> @@ -107,7 +107,7 @@ Despite managing up to 25,000 particles simultaneously, the system maintains smo {\n const dirLightOpt = new DirectionalLightDto();\n dirLightOpt.intensity = 3;\n scene.drawDirectionalLight(dirLightOpt);\n}\n\n// Define the main function to create a parametric flower\nconst start = async () => {\n createEnvironment();\n // Flower parameters - easily adjustable for different designs\n const thickness = 0.1; // Thickness of the flower petals\n const rotationStep = 60; // Degrees between each petal (12 petals total)\n const rotationAxis: Vector3 = [2, 2, 0]; // Axis for petal rotation\n\n // Define control points for the flower petal curve\n const controlPoints: Point3[] = [\n [0, 0, 0], // Start point (flower center)\n [5, 1.25, 7.5], // First control point (petal width)\n [2.75, -1.25, 17.5], // Second control point (petal curve)\n [0, 0, 25] // End point (petal tip)\n ];\n\n // Create interpolated curve through control points\n const curveOptions = new InterpolationDto();\n curveOptions.points = controlPoints;\n curveOptions.periodic = false;\n curveOptions.tolerance = 1e-7;\n const petalCurve = await wire.interpolatePoints(curveOptions);\n\n // Mirror the curve to create symmetry for the petal\n const mirrorOptions = new MirrorAlongNormalDto();\n mirrorOptions.shape = petalCurve;\n mirrorOptions.origin = [0, 0, 0];\n mirrorOptions.normal = [1, 0, 0]; // Mirror along X-axis\n const mirroredCurve = await transforms.mirrorAlongNormal(mirrorOptions);\n\n // Combine the original and mirrored curves into a single wire\n const combineOptions = new ShapesDto();\n combineOptions.shapes = [petalCurve, mirroredCurve];\n const combinedWire = await wire.combineEdgesAndWiresIntoAWire(combineOptions);\n\n // Create a face from the combined wire\n const faceOptions = new FaceFromWireDto();\n faceOptions.shape = combinedWire;\n faceOptions.planar = false; // Allow non-planar surface\n const petalFace = await face.createFaceFromWire(faceOptions);\n\n // Create a thick solid from the face\n const thickOptions = new ThisckSolidSimpleDto();\n thickOptions.shape = petalFace;\n thickOptions.offset = thickness;\n const thickPetal = await operations.makeThickSolidSimple(thickOptions);\n\n // Generate rotation angles for petals (0° to 360° in steps)\n const rotationAngles = vector.span({\n min: 0,\n max: 360,\n step: rotationStep\n });\n\n const rotationAngles2 = vector.span({\n min: 30,\n max: 360,\n step: rotationStep\n });\n\n // Create all flower petals by rotating the base petal\n const flowerPetalPromises: Promise[] = [];\n const flowerPetalPromises2: Promise[] = [];\n\n for (const angle of rotationAngles) {\n const rotateOptions = new RotateDto();\n rotateOptions.shape = thickPetal;\n rotateOptions.axis = rotationAxis;\n rotateOptions.angle = angle;\n\n const rotatedPetal = transforms.rotate(rotateOptions);\n flowerPetalPromises.push(rotatedPetal);\n }\n\n for (const angle of rotationAngles2) {\n const rotateOptions = new RotateDto();\n rotateOptions.shape = thickPetal;\n rotateOptions.axis = rotationAxis;\n rotateOptions.angle = angle;\n\n const rotatedPetal = transforms.rotate(rotateOptions);\n flowerPetalPromises2.push(rotatedPetal);\n }\n\n const flowerPetals = await Promise.all(flowerPetalPromises);\n const flowerPetals2 = await Promise.all(flowerPetalPromises2);\n\n // Combine all petals into a single compound shape\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = flowerPetals;\n const flower = await compound.makeCompound(compoundOptions);\n compoundOptions.shapes = flowerPetals2;\n const flower2 = await compound.makeCompound(compoundOptions);\n\n const pbrOptions = new Bit.Inputs.BabylonMaterial.PBRMetallicRoughnessDto();\n pbrOptions.baseColor = \"#111111\";\n pbrOptions.metallic = 0.6;\n pbrOptions.roughness = 0.6;\n pbrOptions.alpha = 0.4;\n pbrOptions.zOffset = 2;\n const pbrMaterial = pbrMetallicRoughness.create(pbrOptions);\n\n const drawOpt = new Bit.Inputs.Draw.DrawOcctShapeMaterialOptions();\n drawOpt.faceMaterial = pbrMaterial;\n drawOpt.edgeColour = \"#ffffff\";\n drawOpt.drawEdges = true;\n drawOpt.precision = 0.1;\n\n // Draw the completed flower with material options\n const flowerMesh = await bitbybit.draw.drawAnyAsync({\n entity: flower,\n options: drawOpt\n });\n\n const flowerMesh2 = await bitbybit.draw.drawAnyAsync({\n entity: flower2,\n options: drawOpt\n });\n\n const emitterMesh = flowerMesh.getChildMeshes()[0] as BABYLON.Mesh;\n emitterMesh.isPickable = false;\n\n const emitterMesh2 = flowerMesh2.getChildMeshes()[0] as BABYLON.Mesh;\n emitterMesh2.isPickable = false;\n\n const scene = bitbybit.babylon.scene.getScene();\n\n const purpleStartColor = new BABYLON.Color4(0.7, 0.3, 1.0, 1.0);\n const purpleMidColor = new BABYLON.Color4(1.0, 0.4, 0.8, 1.0);\n\n const blueStartColor = new BABYLON.Color4(0.2, 0.7, 1.0, 1.0);\n const blueMidColor = new BABYLON.Color4(0.5, 0.8, 1.0, 1.0);\n\n // This object will be shared with both particle systems to track the mouse.\n const mouseTracker = { position: null as BABYLON.Vector3 | null };\n\n // Create all the 3D assets: emitters, particle systems, and the interaction plane.\n\n // Remove any old observable before adding a new one.\n if (scene.metadata && scene.metadata.observable) {\n scene.metadata.observable.remove();\n }\n\n // Centralized mouse interaction logic.\n const resObs = scene.onPointerObservable.add((pointerInfo) => {\n if (pointerInfo.type === BABYLON.PointerEventTypes.POINTERMOVE) {\n // We only check for hits against our single, invisible interaction plane.\n const pickInfo = scene.pick(scene.pointerX, scene.pointerY, (mesh) => mesh === emitterMesh);\n if (pickInfo.hit) {\n // If we hit the plane, update the shared tracker object's position.\n mouseTracker.position = pickInfo.pickedPoint;\n } else {\n // If the mouse is not over the plane, clear the position.\n mouseTracker.position = null;\n }\n }\n });\n\n if (scene.metadata) {\n scene.metadata.observable = resObs;\n } else {\n scene.metadata = { observable: resObs };\n }\n\n createParticleSystemForMesh(emitterMesh, scene, purpleStartColor, purpleMidColor, mouseTracker);\n createParticleSystemForMesh(emitterMesh2, scene, blueStartColor, blueMidColor, mouseTracker);\n\n}\n\n// Execute the flower creation function\nstart();\n\n\n// The core particle system definition.\nfunction createParticleSystemForMesh(\n emitterMesh: BABYLON.Mesh,\n scene: BABYLON.Scene,\n animStartColor: BABYLON.Color4,\n animMidColor: BABYLON.Color4,\n mouseTracker: { position: BABYLON.Vector3 | null }\n): BABYLON.ParticleSystem {\n\n const animEndColor = new BABYLON.Color4(0.1, 0.2, 0.8, 0.0);\n const DRIFTER_CHANCE = 0.07;\n const DRIFTER_SPEED = 0.4;\n\n const particleSystem = new BABYLON.ParticleSystem(\"particles_\" + emitterMesh.name, 25000, scene);\n particleSystem.particleTexture = new BABYLON.Texture(\"https://assets.babylonjs.com/textures/flare.png\", scene);\n particleSystem.emitter = emitterMesh;\n particleSystem.particleEmitterType = createUniformMeshParticleEmitter(emitterMesh);\n\n particleSystem.color1 = animEndColor.clone();\n particleSystem.color2 = animEndColor.clone();\n particleSystem.colorDead = animEndColor.clone();\n particleSystem.minSize = 0;\n particleSystem.maxSize = 0;\n particleSystem.blendMode = BABYLON.ParticleSystem.BLENDMODE_ONEONE;\n particleSystem.minLifeTime = 4.0;\n particleSystem.maxLifeTime = 8.0;\n particleSystem.emitRate = 2000;\n particleSystem.minEmitPower = 0.1;\n particleSystem.maxEmitPower = 0.5;\n particleSystem.gravity = new BABYLON.Vector3(0, -1.0, 0);\n (particleSystem as any).dragFactor = 0.97;\n\n particleSystem.updateFunction = function (particles) {\n const repulsionRadius = 20.0, repulsionStrength = 30;\n const scaledUpdateSpeed = this._scaledUpdateSpeed;\n const mousePickPosition = mouseTracker.position;\n const regularStartSize = 0.35, regularEndSize = 0.1;\n const largeStartSize = 0.8, largeEndSize = 0.2;\n\n for (let index = 0; index < particles.length; index++) {\n const particle = particles[index] as Particle;\n particle.age += scaledUpdateSpeed;\n if (particle.age >= particle.lifeTime) {\n particles.splice(index, 1); this._stockParticles.push(particle); index--; continue;\n }\n\n if (particle.age === scaledUpdateSpeed) {\n particle.isLarge = (Math.random() < 0.05);\n particle.isDrifter = (Math.random() < DRIFTER_CHANCE);\n if (particle.isDrifter) {\n const driftVector = new BABYLON.Vector3(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5);\n particle.driftDirection = driftVector.normalize();\n }\n }\n\n particle.direction.scaleInPlace(this.dragFactor);\n if (particle.isDrifter) {\n const driftForce = particle.driftDirection.scale(DRIFTER_SPEED * scaledUpdateSpeed);\n particle.direction.addInPlace(driftForce);\n } else {\n particle.direction.addInPlace(this.gravity.scale(scaledUpdateSpeed));\n }\n\n if (mousePickPosition) {\n const distance = BABYLON.Vector3.Distance(particle.position, mousePickPosition);\n if (distance < repulsionRadius) {\n const forceDirection = particle.position.subtract(mousePickPosition).normalize();\n const forceMagnitude = repulsionStrength * (1 - distance / repulsionRadius);\n const forceVector = forceDirection.scale(forceMagnitude * scaledUpdateSpeed);\n particle.direction.addInPlace(forceVector);\n }\n }\n\n particle.position.addInPlace(particle.direction.scale(scaledUpdateSpeed));\n\n const startSize = particle.isLarge ? largeStartSize : regularStartSize;\n const endSize = particle.isLarge ? largeEndSize : regularEndSize;\n const lifeRatio = particle.age / particle.lifeTime;\n const fadeInDuration = 0.1;\n\n if (lifeRatio < fadeInDuration) {\n const fadeInRatio = lifeRatio / fadeInDuration;\n particle.size = BABYLON.Scalar.Lerp(0, startSize, fadeInRatio);\n BABYLON.Color4.LerpToRef(animEndColor, animStartColor, fadeInRatio, particle.color);\n } else {\n const mainLifeRatio = (lifeRatio - fadeInDuration) / (1 - fadeInDuration);\n particle.size = BABYLON.Scalar.Lerp(startSize, endSize, mainLifeRatio);\n if (mainLifeRatio < 0.5) {\n BABYLON.Color4.LerpToRef(animStartColor, animMidColor, mainLifeRatio * 2, particle.color);\n } else {\n BABYLON.Color4.LerpToRef(animMidColor, animEndColor, (mainLifeRatio - 0.5) * 2, particle.color);\n }\n }\n }\n };\n\n particleSystem.start();\n return particleSystem;\n}\n\n// Creates a custom emitter to ensure particles are distributed evenly across a mesh surface.\nfunction createUniformMeshParticleEmitter(mesh: BABYLON.Mesh): BABYLON.CustomParticleEmitter {\n const positions = mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind);\n const indices = mesh.getIndices();\n const totalFaces = indices.length / 3;\n const cumulativeTriangleAreas: number[] = [];\n let totalArea = 0;\n const vA = new BABYLON.Vector3(), vB = new BABYLON.Vector3(), vC = new BABYLON.Vector3();\n const edge1 = new BABYLON.Vector3(), edge2 = new BABYLON.Vector3();\n\n for (let i = 0; i < totalFaces; i++) {\n const indexA = indices[i * 3], indexB = indices[i * 3 + 1], indexC = indices[i * 3 + 2];\n BABYLON.Vector3.FromArrayToRef(positions, indexA * 3, vA);\n BABYLON.Vector3.FromArrayToRef(positions, indexB * 3, vB);\n BABYLON.Vector3.FromArrayToRef(positions, indexC * 3, vC);\n vB.subtractToRef(vA, edge1);\n vC.subtractToRef(vA, edge2);\n const area = BABYLON.Vector3.Cross(edge1, edge2).length() * 0.5;\n totalArea += area;\n cumulativeTriangleAreas.push(totalArea);\n }\n\n for (let i = 0; i < totalFaces; i++) cumulativeTriangleAreas[i] /= totalArea;\n\n const customEmitter = new BABYLON.CustomParticleEmitter();\n customEmitter.particlePositionGenerator = (index, particle, out) => {\n const random = Math.random();\n let triangleIndex = 0;\n for (let i = 0; i < totalFaces; i++) if (random < cumulativeTriangleAreas[i]) { triangleIndex = i; break; }\n const iA = indices[triangleIndex * 3], iB = indices[triangleIndex * 3 + 1], iC = indices[triangleIndex * 3 + 2];\n BABYLON.Vector3.FromArrayToRef(positions, iA * 3, vA);\n BABYLON.Vector3.FromArrayToRef(positions, iB * 3, vB);\n BABYLON.Vector3.FromArrayToRef(positions, iC * 3, vC);\n let r1 = Math.random(), r2 = Math.random();\n if (r1 + r2 > 1) { r1 = 1 - r1; r2 = 1 - r2; }\n vB.subtractToRef(vA, edge1);\n vC.subtractToRef(vA, edge2);\n out.copyFrom(vA).addInPlace(edge1.scaleInPlace(r1)).addInPlace(edge2.scaleInPlace(r2));\n };\n customEmitter.particleDestinationGenerator = (index, particle, out) => {\n out.set(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5);\n };\n return customEmitter;\n}\n","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs for creating curves, shapes, and operations\nconst { InterpolationDto, MirrorAlongNormalDto, ShapesDto, CompoundShapesDto,\n FaceFromWireDto, ThisckSolidSimpleDto, RotateDto } = Bit.Inputs.OCCT;\nconst { SceneTwoColorLinearGradientDto, DirectionalLightDto } = Bit.Inputs.BabylonScene;\nconst { gradientDirectionEnum } = Bit.Inputs.Base;\n\n// Import type definitions for type safety\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer;\n\ninterface Particle extends BABYLON.Particle {\n isLarge: boolean,\n isDrifter: boolean,\n driftDirection: BABYLON.Vector3\n}\n\n// Get access to OCCT modules and utility functions\nconst { wire, face, compound } = bitbybit.occt.shapes;\nconst { operations, transforms } = bitbybit.occt;\nconst { vector } = bitbybit;\nconst { scene } = bitbybit.babylon;\nconst { pbrMetallicRoughness } = bitbybit.babylon.material;\n\n\nconst createEnvironment = async () => {\n const dirLightOpt = new DirectionalLightDto();\n dirLightOpt.intensity = 3;\n scene.drawDirectionalLight(dirLightOpt);\n}\n\n// Define the main function to create a parametric flower\nconst start = async () => {\n createEnvironment();\n // Flower parameters - easily adjustable for different designs\n const thickness = 0.1; // Thickness of the flower petals\n const rotationStep = 60; // Degrees between each petal (12 petals total)\n const rotationAxis: Vector3 = [2, 2, 0]; // Axis for petal rotation\n\n // Define control points for the flower petal curve\n const controlPoints: Point3[] = [\n [0, 0, 0], // Start point (flower center)\n [5, 1.25, 7.5], // First control point (petal width)\n [2.75, -1.25, 17.5], // Second control point (petal curve)\n [0, 0, 25] // End point (petal tip)\n ];\n\n // Create interpolated curve through control points\n const curveOptions = new InterpolationDto();\n curveOptions.points = controlPoints;\n curveOptions.periodic = false;\n curveOptions.tolerance = 1e-7;\n const petalCurve = await wire.interpolatePoints(curveOptions);\n\n // Mirror the curve to create symmetry for the petal\n const mirrorOptions = new MirrorAlongNormalDto();\n mirrorOptions.shape = petalCurve;\n mirrorOptions.origin = [0, 0, 0];\n mirrorOptions.normal = [1, 0, 0]; // Mirror along X-axis\n const mirroredCurve = await transforms.mirrorAlongNormal(mirrorOptions);\n\n // Combine the original and mirrored curves into a single wire\n const combineOptions = new ShapesDto();\n combineOptions.shapes = [petalCurve, mirroredCurve];\n const combinedWire = await wire.combineEdgesAndWiresIntoAWire(combineOptions);\n\n // Create a face from the combined wire\n const faceOptions = new FaceFromWireDto();\n faceOptions.shape = combinedWire;\n faceOptions.planar = false; // Allow non-planar surface\n const petalFace = await face.createFaceFromWire(faceOptions);\n\n // Create a thick solid from the face\n const thickOptions = new ThisckSolidSimpleDto();\n thickOptions.shape = petalFace;\n thickOptions.offset = thickness;\n const thickPetal = await operations.makeThickSolidSimple(thickOptions);\n\n // Generate rotation angles for petals (0° to 360° in steps)\n const rotationAngles = vector.span({\n min: 0,\n max: 360,\n step: rotationStep\n });\n\n const rotationAngles2 = vector.span({\n min: 30,\n max: 360,\n step: rotationStep\n });\n\n // Create all flower petals by rotating the base petal\n const flowerPetalPromises: Promise[] = [];\n const flowerPetalPromises2: Promise[] = [];\n\n for (const angle of rotationAngles) {\n const rotateOptions = new RotateDto();\n rotateOptions.shape = thickPetal;\n rotateOptions.axis = rotationAxis;\n rotateOptions.angle = angle;\n\n const rotatedPetal = transforms.rotate(rotateOptions);\n flowerPetalPromises.push(rotatedPetal);\n }\n\n for (const angle of rotationAngles2) {\n const rotateOptions = new RotateDto();\n rotateOptions.shape = thickPetal;\n rotateOptions.axis = rotationAxis;\n rotateOptions.angle = angle;\n\n const rotatedPetal = transforms.rotate(rotateOptions);\n flowerPetalPromises2.push(rotatedPetal);\n }\n\n const flowerPetals = await Promise.all(flowerPetalPromises);\n const flowerPetals2 = await Promise.all(flowerPetalPromises2);\n\n // Combine all petals into a single compound shape\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = flowerPetals;\n const flower = await compound.makeCompound(compoundOptions);\n compoundOptions.shapes = flowerPetals2;\n const flower2 = await compound.makeCompound(compoundOptions);\n\n const pbrOptions = new Bit.Inputs.BabylonMaterial.PBRMetallicRoughnessDto();\n pbrOptions.baseColor = \"#111111\";\n pbrOptions.metallic = 0.6;\n pbrOptions.roughness = 0.6;\n pbrOptions.alpha = 0.4;\n pbrOptions.zOffset = 2;\n const pbrMaterial = pbrMetallicRoughness.create(pbrOptions);\n\n const drawOpt = new Bit.Inputs.Draw.DrawOcctShapeMaterialOptions();\n drawOpt.faceMaterial = pbrMaterial;\n drawOpt.edgeColour = \"#ffffff\";\n drawOpt.drawEdges = true;\n drawOpt.precision = 0.1;\n\n // Draw the completed flower with material options\n const flowerMesh = await bitbybit.draw.drawAnyAsync({\n entity: flower,\n options: drawOpt\n });\n\n const flowerMesh2 = await bitbybit.draw.drawAnyAsync({\n entity: flower2,\n options: drawOpt\n });\n\n const emitterMesh = flowerMesh.getChildMeshes()[0] as BABYLON.Mesh;\n emitterMesh.isPickable = false;\n\n const emitterMesh2 = flowerMesh2.getChildMeshes()[0] as BABYLON.Mesh;\n emitterMesh2.isPickable = false;\n\n const scene = bitbybit.babylon.scene.getScene();\n\n const purpleStartColor = new BABYLON.Color4(0.7, 0.3, 1.0, 1.0);\n const purpleMidColor = new BABYLON.Color4(1.0, 0.4, 0.8, 1.0);\n\n const blueStartColor = new BABYLON.Color4(0.2, 0.7, 1.0, 1.0);\n const blueMidColor = new BABYLON.Color4(0.5, 0.8, 1.0, 1.0);\n\n // This object will be shared with both particle systems to track the mouse.\n const mouseTracker = { position: null as BABYLON.Vector3 | null };\n\n // Create all the 3D assets: emitters, particle systems, and the interaction plane.\n\n // Remove any old observable before adding a new one.\n if (scene.metadata && scene.metadata.observable) {\n scene.metadata.observable.remove();\n }\n\n // Centralized mouse interaction logic.\n const resObs = scene.onPointerObservable.add((pointerInfo) => {\n if (pointerInfo.type === BABYLON.PointerEventTypes.POINTERMOVE) {\n // We only check for hits against our single, invisible interaction plane.\n const pickInfo = scene.pick(scene.pointerX, scene.pointerY, (mesh) => mesh === emitterMesh);\n if (pickInfo.hit) {\n // If we hit the plane, update the shared tracker object's position.\n mouseTracker.position = pickInfo.pickedPoint;\n } else {\n // If the mouse is not over the plane, clear the position.\n mouseTracker.position = null;\n }\n }\n });\n\n if (scene.metadata) {\n scene.metadata.observable = resObs;\n } else {\n scene.metadata = { observable: resObs };\n }\n\n createParticleSystemForMesh(emitterMesh, scene, purpleStartColor, purpleMidColor, mouseTracker);\n createParticleSystemForMesh(emitterMesh2, scene, blueStartColor, blueMidColor, mouseTracker);\n\n}\n\n// Execute the flower creation function\nstart();\n\n\n// The core particle system definition.\nfunction createParticleSystemForMesh(\n emitterMesh: BABYLON.Mesh,\n scene: BABYLON.Scene,\n animStartColor: BABYLON.Color4,\n animMidColor: BABYLON.Color4,\n mouseTracker: { position: BABYLON.Vector3 | null }\n): BABYLON.ParticleSystem {\n\n const animEndColor = new BABYLON.Color4(0.1, 0.2, 0.8, 0.0);\n const DRIFTER_CHANCE = 0.07;\n const DRIFTER_SPEED = 0.4;\n\n const particleSystem = new BABYLON.ParticleSystem(\"particles_\" + emitterMesh.name, 25000, scene);\n particleSystem.particleTexture = new BABYLON.Texture(\"https://assets.babylonjs.com/textures/flare.png\", scene);\n particleSystem.emitter = emitterMesh;\n particleSystem.particleEmitterType = createUniformMeshParticleEmitter(emitterMesh);\n\n particleSystem.color1 = animEndColor.clone();\n particleSystem.color2 = animEndColor.clone();\n particleSystem.colorDead = animEndColor.clone();\n particleSystem.minSize = 0;\n particleSystem.maxSize = 0;\n particleSystem.blendMode = BABYLON.ParticleSystem.BLENDMODE_ONEONE;\n particleSystem.minLifeTime = 4.0;\n particleSystem.maxLifeTime = 8.0;\n particleSystem.emitRate = 2000;\n particleSystem.minEmitPower = 0.1;\n particleSystem.maxEmitPower = 0.5;\n particleSystem.gravity = new BABYLON.Vector3(0, -1.0, 0);\n (particleSystem as any).dragFactor = 0.97;\n\n particleSystem.updateFunction = function (particles) {\n const repulsionRadius = 20.0, repulsionStrength = 30;\n const scaledUpdateSpeed = this._scaledUpdateSpeed;\n const mousePickPosition = mouseTracker.position;\n const regularStartSize = 0.35, regularEndSize = 0.1;\n const largeStartSize = 0.8, largeEndSize = 0.2;\n\n for (let index = 0; index < particles.length; index++) {\n const particle = particles[index] as Particle;\n particle.age += scaledUpdateSpeed;\n if (particle.age >= particle.lifeTime) {\n particles.splice(index, 1); this._stockParticles.push(particle); index--; continue;\n }\n\n if (particle.age === scaledUpdateSpeed) {\n particle.isLarge = (Math.random() < 0.05);\n particle.isDrifter = (Math.random() < DRIFTER_CHANCE);\n if (particle.isDrifter) {\n const driftVector = new BABYLON.Vector3(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5);\n particle.driftDirection = driftVector.normalize();\n }\n }\n\n particle.direction.scaleInPlace(this.dragFactor);\n if (particle.isDrifter) {\n const driftForce = particle.driftDirection.scale(DRIFTER_SPEED * scaledUpdateSpeed);\n particle.direction.addInPlace(driftForce);\n } else {\n particle.direction.addInPlace(this.gravity.scale(scaledUpdateSpeed));\n }\n\n if (mousePickPosition) {\n const distance = BABYLON.Vector3.Distance(particle.position, mousePickPosition);\n if (distance < repulsionRadius) {\n const forceDirection = particle.position.subtract(mousePickPosition).normalize();\n const forceMagnitude = repulsionStrength * (1 - distance / repulsionRadius);\n const forceVector = forceDirection.scale(forceMagnitude * scaledUpdateSpeed);\n particle.direction.addInPlace(forceVector);\n }\n }\n\n particle.position.addInPlace(particle.direction.scale(scaledUpdateSpeed));\n\n const startSize = particle.isLarge ? largeStartSize : regularStartSize;\n const endSize = particle.isLarge ? largeEndSize : regularEndSize;\n const lifeRatio = particle.age / particle.lifeTime;\n const fadeInDuration = 0.1;\n\n if (lifeRatio < fadeInDuration) {\n const fadeInRatio = lifeRatio / fadeInDuration;\n particle.size = BABYLON.Scalar.Lerp(0, startSize, fadeInRatio);\n BABYLON.Color4.LerpToRef(animEndColor, animStartColor, fadeInRatio, particle.color);\n } else {\n const mainLifeRatio = (lifeRatio - fadeInDuration) / (1 - fadeInDuration);\n particle.size = BABYLON.Scalar.Lerp(startSize, endSize, mainLifeRatio);\n if (mainLifeRatio < 0.5) {\n BABYLON.Color4.LerpToRef(animStartColor, animMidColor, mainLifeRatio * 2, particle.color);\n } else {\n BABYLON.Color4.LerpToRef(animMidColor, animEndColor, (mainLifeRatio - 0.5) * 2, particle.color);\n }\n }\n }\n };\n\n particleSystem.start();\n return particleSystem;\n}\n\n// Creates a custom emitter to ensure particles are distributed evenly across a mesh surface.\nfunction createUniformMeshParticleEmitter(mesh: BABYLON.Mesh): BABYLON.CustomParticleEmitter {\n const positions = mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind);\n const indices = mesh.getIndices();\n const totalFaces = indices.length / 3;\n const cumulativeTriangleAreas: number[] = [];\n let totalArea = 0;\n const vA = new BABYLON.Vector3(), vB = new BABYLON.Vector3(), vC = new BABYLON.Vector3();\n const edge1 = new BABYLON.Vector3(), edge2 = new BABYLON.Vector3();\n\n for (let i = 0; i < totalFaces; i++) {\n const indexA = indices[i * 3], indexB = indices[i * 3 + 1], indexC = indices[i * 3 + 2];\n BABYLON.Vector3.FromArrayToRef(positions, indexA * 3, vA);\n BABYLON.Vector3.FromArrayToRef(positions, indexB * 3, vB);\n BABYLON.Vector3.FromArrayToRef(positions, indexC * 3, vC);\n vB.subtractToRef(vA, edge1);\n vC.subtractToRef(vA, edge2);\n const area = BABYLON.Vector3.Cross(edge1, edge2).length() * 0.5;\n totalArea += area;\n cumulativeTriangleAreas.push(totalArea);\n }\n\n for (let i = 0; i < totalFaces; i++) cumulativeTriangleAreas[i] /= totalArea;\n\n const customEmitter = new BABYLON.CustomParticleEmitter();\n customEmitter.particlePositionGenerator = (index, particle, out) => {\n const random = Math.random();\n let triangleIndex = 0;\n for (let i = 0; i < totalFaces; i++) if (random < cumulativeTriangleAreas[i]) { triangleIndex = i; break; }\n const iA = indices[triangleIndex * 3], iB = indices[triangleIndex * 3 + 1], iC = indices[triangleIndex * 3 + 2];\n BABYLON.Vector3.FromArrayToRef(positions, iA * 3, vA);\n BABYLON.Vector3.FromArrayToRef(positions, iB * 3, vB);\n BABYLON.Vector3.FromArrayToRef(positions, iC * 3, vC);\n let r1 = Math.random(), r2 = Math.random();\n if (r1 + r2 > 1) { r1 = 1 - r1; r2 = 1 - r2; }\n vB.subtractToRef(vA, edge1);\n vC.subtractToRef(vA, edge2);\n out.copyFrom(vA).addInPlace(edge1.scaleInPlace(r1)).addInPlace(edge2.scaleInPlace(r2));\n };\n customEmitter.particleDestinationGenerator = (index, particle, out) => {\n out.set(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5);\n };\n return customEmitter;\n}\n","version":"0.21.0","type":"typescript"}} title="Simple flower" /> diff --git a/docs/learn/code/common/occt/operations/advanced-loft.md b/docs/learn/code/common/occt/operations/advanced-loft.md index 0b3be30d..d969941c 100644 --- a/docs/learn/code/common/occt/operations/advanced-loft.md +++ b/docs/learn/code/common/occt/operations/advanced-loft.md @@ -45,21 +45,21 @@ Here's a breakdown of the process described: nrCornerswire1wire2wire3nrCorners10151515030117910001000100010003wire1000010nrCorners31wire2030010nrCorners10.3wire3070010nrCorners60.5wire3wire2wire1FALSEFALSEFALSEFALSE10FALSE31e-7'approxChordLength'01000-300.01TRUE#cc33ccTRUE#ffffff2","version":"0.20.14","type":"blockly"}} + script={{"script":"nrCornerswire1wire2wire3nrCorners10151515030117910001000100010003wire1000010nrCorners31wire2030010nrCorners10.3wire3070010nrCorners60.5wire3wire2wire1FALSEFALSEFALSEFALSE10FALSE31e-7'approxChordLength'01000-300.01TRUE#cc33ccTRUE#ffffff2","version":"0.21.0","type":"blockly"}} title="Advanced Loft Operation" /> {\n\n // --- 1. Camera Configuration ---\n // Create a new configuration object for the scene's Arc Rotate Camera.\n const arcCameraOptions = new CameraConfigurationDto();\n // Set the camera's position in 3D space (x, y, z).\n arcCameraOptions.position = [15, 15, 15];\n // Set the point the camera will look at.\n arcCameraOptions.lookAt = [0, 3, 0];\n // Apply these settings to the active camera in the scene.\n scene.adjustActiveArcRotateCamera(arcCameraOptions);\n\n // Define the number of corners for the polygonal profiles.\n const nrCorners = 10;\n\n // --- 2. Create the First Profile (Bottom) ---\n // Create a DTO to define an n-sided polygon wire.\n const ngonOpt = new NGonWireDto();\n ngonOpt.nrCorners = nrCorners;\n ngonOpt.radius = 3;\n // Asynchronously create the first polygon wire shape at the default center [0,0,0].\n const wire1 = await wire.createNGonWire(ngonOpt);\n\n // Create a DTO for a 2D fillet operation to round the corners of a wire.\n const filletOpt = new FilletDto();\n filletOpt.radius = 0.3; // The radius of the rounded corners.\n filletOpt.shape = wire1; // Specify that the fillet should be applied to wire1.\n // Asynchronously apply the fillet and store the new, smoothed wire.\n const filletedWire1 = await fillets.fillet2d(filletOpt);\n\n // --- 3. Create the Second Profile (Middle) ---\n // Reuse the ngonOpt DTO but modify its properties for the next shape.\n ngonOpt.center = [0, 3, 0]; // Move the center up along the Y-axis.\n ngonOpt.radius = 1; // Make this polygon smaller.\n const wire2 = await wire.createNGonWire(ngonOpt);\n\n // Reuse the filletOpt DTO to apply the same fillet radius to the new wire.\n filletOpt.shape = wire2;\n const filletedWire2 = await fillets.fillet2d(filletOpt);\n\n // --- 4. Create the Third Profile (Top) ---\n // Reuse and modify the DTOs again for the third and final profile.\n ngonOpt.center = [0, 7, 0]; // Move this one even higher.\n ngonOpt.radius = 6; // Make this polygon the largest.\n const wire3 = await wire.createNGonWire(ngonOpt);\n\n // Use a larger fillet radius for this larger wire.\n filletOpt.radius = 0.5;\n filletOpt.shape = wire3;\n const filletedWire3 = await fillets.fillet2d(filletOpt);\n\n // --- 5. Perform the Loft Operation ---\n // A loft creates a 3D solid by connecting a series of 2D profiles.\n const loftAdvancedOptions = new LoftAdvancedDto();\n // Specify a single point where the loft should begin, creating a pointed top.\n loftAdvancedOptions.startVertex = [0, 10, 0];\n // Specify a single point where the loft should end, creating a pointed bottom.\n loftAdvancedOptions.endVertex = [0, -3, 0];\n // Provide the array of profiles to connect. The order matters.\n loftAdvancedOptions.shapes = [filletedWire3, filletedWire2, filletedWire1];\n // Asynchronously execute the loft operation to create the final 3D shape.\n const loftedShape = await operations.loftAdvanced(loftAdvancedOptions)\n\n // --- 6. Draw the Final Shape ---\n // Create a DTO to define how the shape should be drawn.\n const drawOptions = new DrawOcctShapeSimpleOptions();\n // Set the color of the shape's faces to magenta.\n drawOptions.faceColour = \"#ff00ff\";\n\n // Call the generic drawing function to render the OCCT shape in the scene.\n bitbybit.draw.drawAnyAsync({\n entity: loftedShape, // The shape to draw.\n options: drawOptions // The drawing options to apply.\n });\n\n}\n\n// Execute the main function to start the script.\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"\n// Import DTOs for configuring various operations. DTOs are objects used to pass data.\n// Import camera configuration for setting up the scene view.\nconst { CameraConfigurationDto } = Bit.Inputs.BabylonScene;\n// Import DTOs for OpenCASCADE (OCCT) geometric modeling: creating polygons, fillets, and lofts.\nconst { NGonWireDto, FilletDto, LoftAdvancedDto } = Bit.Inputs.OCCT;\n// Import DTO for specifying drawing options, like color and opacity.\nconst { DrawOcctShapeSimpleOptions } = Bit.Inputs.Draw;\n// Import a specific type for an OCCT wire, ensuring type safety in our code.\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\n\n// Destructure the bitbybit API to get direct access to its main modules.\n// 'scene' provides access to Babylon.js scene controls.\nconst { scene } = bitbybit.babylon;\n// 'wire', 'fillets', and 'operations' are part of the OCCT module for creating and manipulating shapes.\nconst { wire } = bitbybit.occt.shapes;\nconst { fillets, operations } = bitbybit.occt;\n\n// Define an asynchronous function to execute the main logic.\n// Using async/await is necessary because geometry creation and drawing are non-blocking operations.\nconst start = async () => {\n\n // --- 1. Camera Configuration ---\n // Create a new configuration object for the scene's Arc Rotate Camera.\n const arcCameraOptions = new CameraConfigurationDto();\n // Set the camera's position in 3D space (x, y, z).\n arcCameraOptions.position = [15, 15, 15];\n // Set the point the camera will look at.\n arcCameraOptions.lookAt = [0, 3, 0];\n // Apply these settings to the active camera in the scene.\n scene.adjustActiveArcRotateCamera(arcCameraOptions);\n\n // Define the number of corners for the polygonal profiles.\n const nrCorners = 10;\n\n // --- 2. Create the First Profile (Bottom) ---\n // Create a DTO to define an n-sided polygon wire.\n const ngonOpt = new NGonWireDto();\n ngonOpt.nrCorners = nrCorners;\n ngonOpt.radius = 3;\n // Asynchronously create the first polygon wire shape at the default center [0,0,0].\n const wire1 = await wire.createNGonWire(ngonOpt);\n\n // Create a DTO for a 2D fillet operation to round the corners of a wire.\n const filletOpt = new FilletDto();\n filletOpt.radius = 0.3; // The radius of the rounded corners.\n filletOpt.shape = wire1; // Specify that the fillet should be applied to wire1.\n // Asynchronously apply the fillet and store the new, smoothed wire.\n const filletedWire1 = await fillets.fillet2d(filletOpt);\n\n // --- 3. Create the Second Profile (Middle) ---\n // Reuse the ngonOpt DTO but modify its properties for the next shape.\n ngonOpt.center = [0, 3, 0]; // Move the center up along the Y-axis.\n ngonOpt.radius = 1; // Make this polygon smaller.\n const wire2 = await wire.createNGonWire(ngonOpt);\n\n // Reuse the filletOpt DTO to apply the same fillet radius to the new wire.\n filletOpt.shape = wire2;\n const filletedWire2 = await fillets.fillet2d(filletOpt);\n\n // --- 4. Create the Third Profile (Top) ---\n // Reuse and modify the DTOs again for the third and final profile.\n ngonOpt.center = [0, 7, 0]; // Move this one even higher.\n ngonOpt.radius = 6; // Make this polygon the largest.\n const wire3 = await wire.createNGonWire(ngonOpt);\n\n // Use a larger fillet radius for this larger wire.\n filletOpt.radius = 0.5;\n filletOpt.shape = wire3;\n const filletedWire3 = await fillets.fillet2d(filletOpt);\n\n // --- 5. Perform the Loft Operation ---\n // A loft creates a 3D solid by connecting a series of 2D profiles.\n const loftAdvancedOptions = new LoftAdvancedDto();\n // Specify a single point where the loft should begin, creating a pointed top.\n loftAdvancedOptions.startVertex = [0, 10, 0];\n // Specify a single point where the loft should end, creating a pointed bottom.\n loftAdvancedOptions.endVertex = [0, -3, 0];\n // Provide the array of profiles to connect. The order matters.\n loftAdvancedOptions.shapes = [filletedWire3, filletedWire2, filletedWire1];\n // Asynchronously execute the loft operation to create the final 3D shape.\n const loftedShape = await operations.loftAdvanced(loftAdvancedOptions)\n\n // --- 6. Draw the Final Shape ---\n // Create a DTO to define how the shape should be drawn.\n const drawOptions = new DrawOcctShapeSimpleOptions();\n // Set the color of the shape's faces to magenta.\n drawOptions.faceColour = \"#ff00ff\";\n\n // Call the generic drawing function to render the OCCT shape in the scene.\n bitbybit.draw.drawAnyAsync({\n entity: loftedShape, // The shape to draw.\n options: drawOptions // The drawing options to apply.\n });\n\n}\n\n// Execute the main function to start the script.\nstart();","version":"0.21.0","type":"typescript"}} title="Advanced Loft Operation" /> diff --git a/docs/learn/code/common/occt/operations/extrusions.md b/docs/learn/code/common/occt/operations/extrusions.md index 20e53872..34ab5df5 100644 --- a/docs/learn/code/common/occt/operations/extrusions.md +++ b/docs/learn/code/common/occt/operations/extrusions.md @@ -35,21 +35,21 @@ By understanding extrusion, you gain a powerful tool for your 3D modeling toolki heightheight40000107740FALSE0.50height0","version":"0.20.14","type":"blockly"}} + script={{"script":"heightheight40000107740FALSE0.50height0","version":"0.21.0","type":"blockly"}} title="Extrude the wire into shell kind of shape" /> {\n\n // Define a constant 'height' for the extrusion operation.\n const height = 4;\n\n // Create a new StarDto instance to configure the properties of a star-shaped wire.\n const starOpt = new StarDto();\n // Set the inner radius of the star.\n starOpt.innerRadius = 4;\n // Set the outer radius of the star.\n starOpt.outerRadius = 7;\n // Asynchronously create the star-shaped wire using the configured options.\n // The 'await' keyword pauses execution until the wire creation is complete.\n // Bitbybit runs such CAD operations in the worker thread, which doesn't block UI\n // and is usually faster.\n const star = await wire.createStarWire(starOpt);\n\n // Create a new FilletDto instance to configure a 2D fillet operation.\n // The generic type specifies that this fillet will be applied to a wire.\n const filletOpt = new FilletDto();\n // Set the shape to be filleted to the previously created star wire.\n filletOpt.shape = star;\n // Set the radius for the fillet (rounding of corners).\n filletOpt.radius = 0.5;\n // Asynchronously apply the 2D fillet to the star wire.\n const roundedStar = await fillets.fillet2d(filletOpt);\n\n // Create a new ExtrudeDto instance to configure an extrusion operation.\n // The generic type specifies that a wire will be extruded.\n const extrudeOpt = new ExtrudeDto();\n // Set the shape to be extruded to the previously created rounded star wire.\n extrudeOpt.shape = roundedStar;\n // Set the direction and magnitude of the extrusion as a 3D vector [x, y, z].\n // Here, it extrudes along the Y-axis by the value of 'height'.\n extrudeOpt.direction = [0, height, 0];\n // Asynchronously perform the extrusion operation on the rounded star wire.\n const extrudedRoundStar = await operations.extrude(extrudeOpt);\n\n // Asynchronously draw the final extruded shape in the 3D scene.\n // 'entity' specifies the shape to be drawn.\n bitbybit.draw.drawAnyAsync({ entity: extrudedRoundStar });\n\n}\n\n// Call the 'start' function to execute the script.\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import the 'wire' module for creating wire shapes from the OCCT (OpenCASCADE Technology) library.\nconst { wire } = bitbybit.occt.shapes;\n// Import 'fillets' and 'operations' modules for performing filleting and extrusion operations on OCCT shapes.\nconst { fillets, operations } = bitbybit.occt;\n// Import Data Transfer Objects (DTOs) for configuring star creation, filleting, and extrusion.\n// DTOs are used to pass parameters to the respective functions.\nconst { StarDto, FilletDto, ExtrudeDto } = Bit.Inputs.OCCT;\n// Define a type alias for a pointer to a TopoDS_Wire, which is an OCCT data structure representing a wire.\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\n\n// Define an asynchronous function named 'start' which will contain the main logic for creating and drawing the shape.\n// The 'async' keyword allows the use of 'await' for operations that might take time, like geometry creation.\nconst start = async () => {\n\n // Define a constant 'height' for the extrusion operation.\n const height = 4;\n\n // Create a new StarDto instance to configure the properties of a star-shaped wire.\n const starOpt = new StarDto();\n // Set the inner radius of the star.\n starOpt.innerRadius = 4;\n // Set the outer radius of the star.\n starOpt.outerRadius = 7;\n // Asynchronously create the star-shaped wire using the configured options.\n // The 'await' keyword pauses execution until the wire creation is complete.\n // Bitbybit runs such CAD operations in the worker thread, which doesn't block UI\n // and is usually faster.\n const star = await wire.createStarWire(starOpt);\n\n // Create a new FilletDto instance to configure a 2D fillet operation.\n // The generic type specifies that this fillet will be applied to a wire.\n const filletOpt = new FilletDto();\n // Set the shape to be filleted to the previously created star wire.\n filletOpt.shape = star;\n // Set the radius for the fillet (rounding of corners).\n filletOpt.radius = 0.5;\n // Asynchronously apply the 2D fillet to the star wire.\n const roundedStar = await fillets.fillet2d(filletOpt);\n\n // Create a new ExtrudeDto instance to configure an extrusion operation.\n // The generic type specifies that a wire will be extruded.\n const extrudeOpt = new ExtrudeDto();\n // Set the shape to be extruded to the previously created rounded star wire.\n extrudeOpt.shape = roundedStar;\n // Set the direction and magnitude of the extrusion as a 3D vector [x, y, z].\n // Here, it extrudes along the Y-axis by the value of 'height'.\n extrudeOpt.direction = [0, height, 0];\n // Asynchronously perform the extrusion operation on the rounded star wire.\n const extrudedRoundStar = await operations.extrude(extrudeOpt);\n\n // Asynchronously draw the final extruded shape in the 3D scene.\n // 'entity' specifies the shape to be drawn.\n bitbybit.draw.drawAnyAsync({ entity: extrudedRoundStar });\n\n}\n\n// Call the 'start' function to execute the script.\nstart();","version":"0.21.0","type":"typescript"}} title="Extrude the wire into shell kind of shape" /> @@ -69,21 +69,21 @@ In the following examples, we first construct a complex wire, then create a plan heightheight4000010070000100520FALSEFALSETRUETRUE0height0","version":"0.20.14","type":"blockly"}} + script={{"script":"heightheight4000010070000100520FALSEFALSETRUETRUE0height0","version":"0.21.0","type":"blockly"}} title="Extrude the face into solid shape" /> {\n\n const height = 4;\n\n const heartOpt = new Heart2DDto();\n heartOpt.sizeApprox = 7;\n const heart1 = await wire.createHeartWire(heartOpt);\n\n heartOpt.sizeApprox = 5;\n const heart2 = await wire.createHeartWire(heartOpt);\n\n const zigZagOpt = new ZigZagBetweenTwoWiresDto(heart1, heart2, 31);\n const zigZagWire = await wire.createZigZagBetweenTwoWires(zigZagOpt);\n\n const faceFromWireOpt = new FaceFromWireDto(zigZagWire, true);\n const zigZagFace = await face.createFaceFromWire(faceFromWireOpt);\n \n const extrudeOpt = new ExtrudeDto();\n extrudeOpt.shape = zigZagFace;\n extrudeOpt.direction = [0, height, 0];\n const extrudedZigZag = await operations.extrude(extrudeOpt);\n\n bitbybit.draw.drawAnyAsync({ entity: extrudedZigZag });\n\n}\n\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const { wire, face } = bitbybit.occt.shapes;\nconst { fillets, operations } = bitbybit.occt;\nconst { FilletDto, ExtrudeDto, Heart2DDto, ZigZagBetweenTwoWiresDto, FaceFromWireDto } = Bit.Inputs.OCCT;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\nconst start = async () => {\n\n const height = 4;\n\n const heartOpt = new Heart2DDto();\n heartOpt.sizeApprox = 7;\n const heart1 = await wire.createHeartWire(heartOpt);\n\n heartOpt.sizeApprox = 5;\n const heart2 = await wire.createHeartWire(heartOpt);\n\n const zigZagOpt = new ZigZagBetweenTwoWiresDto(heart1, heart2, 31);\n const zigZagWire = await wire.createZigZagBetweenTwoWires(zigZagOpt);\n\n const faceFromWireOpt = new FaceFromWireDto(zigZagWire, true);\n const zigZagFace = await face.createFaceFromWire(faceFromWireOpt);\n \n const extrudeOpt = new ExtrudeDto();\n extrudeOpt.shape = zigZagFace;\n extrudeOpt.direction = [0, height, 0];\n const extrudedZigZag = await operations.extrude(extrudeOpt);\n\n bitbybit.draw.drawAnyAsync({ entity: extrudedZigZag });\n\n}\n\nstart();","version":"0.21.0","type":"typescript"}} title="Extrude the face into solid shape" /> diff --git a/docs/learn/code/common/occt/operations/offset-operations.md b/docs/learn/code/common/occt/operations/offset-operations.md index 77367c35..a4320400 100644 --- a/docs/learn/code/common/occt/operations/offset-operations.md +++ b/docs/learn/code/common/occt/operations/offset-operations.md @@ -44,21 +44,21 @@ Key parameters for wire offset include: hexagonoffsetDistanceoffsetShapehexagon00001046offsetDistance1.2offsetShapehexagonoffsetDistance0.1hexagon#00ff004offsetShape#ff00004","version":"0.20.14","type":"blockly"}} + script={{"script":"hexagonoffsetDistanceoffsetShapehexagon00001046offsetDistance1.2offsetShapehexagonoffsetDistance0.1hexagon#00ff004offsetShape#ff00004","version":"0.21.0","type":"blockly"}} title="Basic Wire Offset Operation" /> {\n\n // Define the offset distance - positive values expand the shape, negative values contract it\n const offsetDistance = 1.2;\n\n // Create a new NGonWireDto instance to configure a hexagonal wire\n const hexagonOpt = new Bit.Inputs.OCCT.NGonWireDto();\n // Set the center point of the polygon\n hexagonOpt.center = [0, 0, 0];\n // Set the direction vector (normal to the plane of the polygon)\n hexagonOpt.direction = [0, 1, 0];\n // Set the radius from center to vertices\n hexagonOpt.radius = 4;\n // Set the number of corners (6 for hexagon)\n hexagonOpt.nrCorners = 6;\n \n // Create the hexagonal wire\n const hexagon = await wire.createNGonWire(hexagonOpt);\n\n // Create a new OffsetDto instance to configure the offset operation\n const offsetOpt = new OffsetDto();\n // Set the shape to be offset\n offsetOpt.shape = hexagon;\n // Set the offset distance (positive = outward, negative = inward)\n offsetOpt.distance = offsetDistance;\n // Set the tolerance for the offset calculation\n offsetOpt.tolerance = 0.1;\n \n // Perform the offset operation\n const offsetShape = await operations.offset(offsetOpt);\n\n // Draw both the original and offset shapes with different colors for comparison\n const originalOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n originalOptions.edgeWidth = 4;\n originalOptions.edgeColour = \"#00ff00\"; // Green for original\n \n const offsetOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offsetOptions.edgeWidth = 4;\n offsetOptions.edgeColour = \"#ff0000\"; // Red for offset\n \n bitbybit.draw.drawAnyAsync({ entity: hexagon, options: originalOptions });\n bitbybit.draw.drawAnyAsync({ entity: offsetShape, options: offsetOptions });\n\n}\n\n// Call the 'start' function to execute the script\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import the 'wire' module for creating wire shapes from the OCCT library\nconst { wire } = bitbybit.occt.shapes;\n// Import the 'operations' module for offset operations\nconst { operations } = bitbybit.occt;\n// Import Data Transfer Objects (DTOs) for configuring polygon creation and offset operations\nconst { NGonWireDto, OffsetDto } = Bit.Inputs.OCCT;\n// Define a type alias for a pointer to a TopoDS_Wire\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\n\n// Define an asynchronous function named 'start' which will contain the main logic\nconst start = async () => {\n\n // Define the offset distance - positive values expand the shape, negative values contract it\n const offsetDistance = 1.2;\n\n // Create a new NGonWireDto instance to configure a hexagonal wire\n const hexagonOpt = new Bit.Inputs.OCCT.NGonWireDto();\n // Set the center point of the polygon\n hexagonOpt.center = [0, 0, 0];\n // Set the direction vector (normal to the plane of the polygon)\n hexagonOpt.direction = [0, 1, 0];\n // Set the radius from center to vertices\n hexagonOpt.radius = 4;\n // Set the number of corners (6 for hexagon)\n hexagonOpt.nrCorners = 6;\n \n // Create the hexagonal wire\n const hexagon = await wire.createNGonWire(hexagonOpt);\n\n // Create a new OffsetDto instance to configure the offset operation\n const offsetOpt = new OffsetDto();\n // Set the shape to be offset\n offsetOpt.shape = hexagon;\n // Set the offset distance (positive = outward, negative = inward)\n offsetOpt.distance = offsetDistance;\n // Set the tolerance for the offset calculation\n offsetOpt.tolerance = 0.1;\n \n // Perform the offset operation\n const offsetShape = await operations.offset(offsetOpt);\n\n // Draw both the original and offset shapes with different colors for comparison\n const originalOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n originalOptions.edgeWidth = 4;\n originalOptions.edgeColour = \"#00ff00\"; // Green for original\n \n const offsetOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offsetOptions.edgeWidth = 4;\n offsetOptions.edgeColour = \"#ff0000\"; // Red for offset\n \n bitbybit.draw.drawAnyAsync({ entity: hexagon, options: originalOptions });\n bitbybit.draw.drawAnyAsync({ entity: offsetShape, options: offsetOptions });\n\n}\n\n// Call the 'start' function to execute the script\nstart();","version":"0.21.0","type":"typescript"}} title="Basic Wire Offset Operation" /> @@ -83,21 +83,21 @@ The join types available are: starWireoffsetDistanceoffsetShapestarWire000010531.50FALSEoffsetDistance0.8offsetShapestarWireoffsetDistance0.1intersectionFALSEstarWire#00ff004offsetShape#ff00004","version":"0.20.14","type":"blockly"}} + script={{"script":"starWireoffsetDistanceoffsetShapestarWire000010531.50FALSEoffsetDistance0.8offsetShapestarWireoffsetDistance0.1intersectionFALSEstarWire#00ff004offsetShape#ff00004","version":"0.21.0","type":"blockly"}} title="Advanced Offset with Join Type Control" /> {\n\n // Define the offset distance\n const offsetDistance = 0.8;\n\n // Create a star-shaped wire for demonstration\n const starOpt = new StarDto();\n starOpt.center = [0, 0, 0];\n starOpt.direction = [0, 1, 0];\n starOpt.numRays = 5;\n starOpt.outerRadius = 3;\n starOpt.innerRadius = 1.5;\n \n const starWire = await wire.createStarWire(starOpt);\n\n // Create an advanced offset with specific join type\n const offsetAdvOpt = new OffsetAdvancedDto();\n offsetAdvOpt.shape = starWire;\n offsetAdvOpt.distance = offsetDistance;\n offsetAdvOpt.tolerance = 0.1;\n // Set join type to 'intersection' for sharp corners\n // Other options: 'arc' (rounded), 'tangent' (beveled)\n offsetAdvOpt.joinType = Bit.Inputs.OCCT.joinTypeEnum.intersection;\n offsetAdvOpt.removeIntEdges = false;\n \n const offsetShape = await operations.offsetAdv(offsetAdvOpt);\n\n // Draw both shapes with different colors for comparison\n const originalOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n originalOptions.edgeWidth = 4;\n originalOptions.edgeColour = \"#00ff00\"; // Green for original\n \n const offsetOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offsetOptions.edgeWidth = 4;\n offsetOptions.edgeColour = \"#ff0000\"; // Red for offset\n \n bitbybit.draw.drawAnyAsync({ entity: starWire, options: originalOptions });\n bitbybit.draw.drawAnyAsync({ entity: offsetShape, options: offsetOptions });\n\n}\n\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required modules for wire creation and operations\nconst { wire } = bitbybit.occt.shapes;\nconst { operations } = bitbybit.occt;\n// Import DTOs and enums for star creation and advanced offset\nconst { StarDto, OffsetAdvancedDto } = Bit.Inputs.OCCT;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\n\nconst start = async () => {\n\n // Define the offset distance\n const offsetDistance = 0.8;\n\n // Create a star-shaped wire for demonstration\n const starOpt = new StarDto();\n starOpt.center = [0, 0, 0];\n starOpt.direction = [0, 1, 0];\n starOpt.numRays = 5;\n starOpt.outerRadius = 3;\n starOpt.innerRadius = 1.5;\n \n const starWire = await wire.createStarWire(starOpt);\n\n // Create an advanced offset with specific join type\n const offsetAdvOpt = new OffsetAdvancedDto();\n offsetAdvOpt.shape = starWire;\n offsetAdvOpt.distance = offsetDistance;\n offsetAdvOpt.tolerance = 0.1;\n // Set join type to 'intersection' for sharp corners\n // Other options: 'arc' (rounded), 'tangent' (beveled)\n offsetAdvOpt.joinType = Bit.Inputs.OCCT.joinTypeEnum.intersection;\n offsetAdvOpt.removeIntEdges = false;\n \n const offsetShape = await operations.offsetAdv(offsetAdvOpt);\n\n // Draw both shapes with different colors for comparison\n const originalOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n originalOptions.edgeWidth = 4;\n originalOptions.edgeColour = \"#00ff00\"; // Green for original\n \n const offsetOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offsetOptions.edgeWidth = 4;\n offsetOptions.edgeColour = \"#ff0000\"; // Red for offset\n \n bitbybit.draw.drawAnyAsync({ entity: starWire, options: originalOptions });\n bitbybit.draw.drawAnyAsync({ entity: offsetShape, options: offsetOptions });\n\n}\n\nstart();","version":"0.21.0","type":"typescript"}} title="Advanced Offset with Join Type Control" /> @@ -117,21 +117,21 @@ The thick solid operation takes a shell (collection of connected faces) or a fac circleWirecircularFacethicknessthickSolidcircleWire0000103circularFacecircleWireTRUEthickness0.5thickSolidcircularFacethicknesstranslatedSolidthickSolid010circularFace#00ff004translatedSolid#ff00004","version":"0.20.14","type":"blockly"}} + script={{"script":"circleWirecircularFacethicknessthickSolidcircleWire0000103circularFacecircleWireTRUEthickness0.5thickSolidcircularFacethicknesstranslatedSolidthickSolid010circularFace#00ff004translatedSolid#ff00004","version":"0.21.0","type":"blockly"}} title="Creating Thick Solid from Face" /> {\n\n // Define the thickness for the solid\n const thickness = 0.5;\n\n // Step 1: Create a circular wire\n const circleOpt = new CircleDto();\n circleOpt.center = [0, 0, 0];\n circleOpt.direction = [0, 1, 0];\n circleOpt.radius = 3;\n \n const circleWire = await wire.createCircleWire(circleOpt);\n\n // Step 2: Convert the wire to a face\n const faceOpt = new FaceFromWireDto();\n faceOpt.shape = circleWire;\n faceOpt.planar = true;\n \n const circularFace = await face.createFaceFromWire(faceOpt);\n\n // Step 3: Create a thick solid from the face\n const thickSolidOpt = new ThisckSolidSimpleDto();\n thickSolidOpt.shape = circularFace;\n // Positive offset creates thickness in the direction of the face normal\n thickSolidOpt.offset = thickness;\n \n const thickSolid = await operations.makeThickSolidSimple(thickSolidOpt);\n\n // Step 4: Translate the thick solid upwards to make the original face visible\n const translationOpt = new TranslateDto();\n translationOpt.shape = thickSolid;\n translationOpt.translation = [0, 1, 0]; // Move up by 1 unit\n \n const translatedSolid = await transforms.translate(translationOpt);\n\n // Draw both the original face and resulting thick solid with different colors for comparison\n const originalOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n originalOptions.edgeWidth = 4;\n originalOptions.edgeColour = \"#00ff00\"; // Green for original\n \n const thickSolidOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n thickSolidOptions.edgeWidth = 4;\n thickSolidOptions.edgeColour = \"#ff0000\"; // Red for thick solid\n \n bitbybit.draw.drawAnyAsync({ entity: circularFace, options: originalOptions });\n bitbybit.draw.drawAnyAsync({ entity: translatedSolid, options: thickSolidOptions });\n\n}\n\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required modules for wire, face creation and operations\nconst { wire, face } = bitbybit.occt.shapes;\nconst { operations, transforms } = bitbybit.occt;\n// Import DTOs for circle, face and thick solid creation\nconst { CircleDto, FaceFromWireDto, ThisckSolidSimpleDto, TranslateDto } = Bit.Inputs.OCCT;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\n\nconst start = async () => {\n\n // Define the thickness for the solid\n const thickness = 0.5;\n\n // Step 1: Create a circular wire\n const circleOpt = new CircleDto();\n circleOpt.center = [0, 0, 0];\n circleOpt.direction = [0, 1, 0];\n circleOpt.radius = 3;\n \n const circleWire = await wire.createCircleWire(circleOpt);\n\n // Step 2: Convert the wire to a face\n const faceOpt = new FaceFromWireDto();\n faceOpt.shape = circleWire;\n faceOpt.planar = true;\n \n const circularFace = await face.createFaceFromWire(faceOpt);\n\n // Step 3: Create a thick solid from the face\n const thickSolidOpt = new ThisckSolidSimpleDto();\n thickSolidOpt.shape = circularFace;\n // Positive offset creates thickness in the direction of the face normal\n thickSolidOpt.offset = thickness;\n \n const thickSolid = await operations.makeThickSolidSimple(thickSolidOpt);\n\n // Step 4: Translate the thick solid upwards to make the original face visible\n const translationOpt = new TranslateDto();\n translationOpt.shape = thickSolid;\n translationOpt.translation = [0, 1, 0]; // Move up by 1 unit\n \n const translatedSolid = await transforms.translate(translationOpt);\n\n // Draw both the original face and resulting thick solid with different colors for comparison\n const originalOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n originalOptions.edgeWidth = 4;\n originalOptions.edgeColour = \"#00ff00\"; // Green for original\n \n const thickSolidOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n thickSolidOptions.edgeWidth = 4;\n thickSolidOptions.edgeColour = \"#ff0000\"; // Red for thick solid\n \n bitbybit.draw.drawAnyAsync({ entity: circularFace, options: originalOptions });\n bitbybit.draw.drawAnyAsync({ entity: translatedSolid, options: thickSolidOptions });\n\n}\n\nstart();","version":"0.21.0","type":"typescript"}} title="Creating Thick Solid from Face" /> @@ -151,21 +151,21 @@ This operation works by: curvedWireoffsetDistanceextrusionDirectionoffset3DWirecurvedWire0002124-11623FALSEoffsetDistance0.5extrusionDirection010offset3DWirecurvedWireextrusionDirectionoffsetDistancecurvedWire#00ff004offset3DWire#ff00004","version":"0.20.14","type":"blockly"}} + script={{"script":"curvedWireoffsetDistanceextrusionDirectionoffset3DWirecurvedWire0002124-11623FALSEoffsetDistance0.5extrusionDirection010offset3DWirecurvedWireextrusionDirectionoffsetDistancecurvedWire#00ff004offset3DWire#ff00004","version":"0.21.0","type":"blockly"}} title="3D Wire Offset Operation" /> {\n\n // Define parameters for the 3D offset\n const offsetDistance = 0.5;\n const extrusionDirection = [0, 1, 0]; // Y-axis direction\n\n // Step 1: Create a curved 3D wire using B-spline\n const curveOpt = new BSplineDto();\n // Define control points for a truly 3D curve with varying Y coordinates\n curveOpt.points = [\n [0, 0, 0], // Start point\n [2, 1, 2], // First control point (elevated in Y)\n [4, -1, 1], // Second control point (lowered in Y)\n [6, 2, 3] // End point (elevated in Y and Z)\n ];\n curveOpt.closed = false;\n \n const curvedWire = await wire.createBSpline(curveOpt);\n\n // Step 2: Create 3D offset of the wire\n const offset3DOpt = new Offset3DWireDto();\n offset3DOpt.shape = curvedWire;\n // Direction for the temporary extrusion used in the offset calculation\n offset3DOpt.direction = extrusionDirection as Bit.Inputs.Base.Point3;\n // Distance to offset the wire\n offset3DOpt.offset = offsetDistance;\n \n const offset3DWire = await operations.offset3DWire(offset3DOpt);\n\n // Draw both the original and offset wires with different colors for comparison\n const originalOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n originalOptions.edgeWidth = 4;\n originalOptions.edgeColour = \"#00ff00\"; // Green for original\n \n const offsetOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offsetOptions.edgeWidth = 4;\n offsetOptions.edgeColour = \"#ff0000\"; // Red for offset\n \n bitbybit.draw.drawAnyAsync({ entity: curvedWire, options: originalOptions });\n bitbybit.draw.drawAnyAsync({ entity: offset3DWire, options: offsetOptions });\n\n}\n\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required modules for wire creation and operations\nconst { wire } = bitbybit.occt.shapes;\nconst { operations } = bitbybit.occt;\n// Import DTOs for BSpline and 3D wire offset\nconst { BSplineDto, Offset3DWireDto } = Bit.Inputs.OCCT;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\n\nconst start = async () => {\n\n // Define parameters for the 3D offset\n const offsetDistance = 0.5;\n const extrusionDirection = [0, 1, 0]; // Y-axis direction\n\n // Step 1: Create a curved 3D wire using B-spline\n const curveOpt = new BSplineDto();\n // Define control points for a truly 3D curve with varying Y coordinates\n curveOpt.points = [\n [0, 0, 0], // Start point\n [2, 1, 2], // First control point (elevated in Y)\n [4, -1, 1], // Second control point (lowered in Y)\n [6, 2, 3] // End point (elevated in Y and Z)\n ];\n curveOpt.closed = false;\n \n const curvedWire = await wire.createBSpline(curveOpt);\n\n // Step 2: Create 3D offset of the wire\n const offset3DOpt = new Offset3DWireDto();\n offset3DOpt.shape = curvedWire;\n // Direction for the temporary extrusion used in the offset calculation\n offset3DOpt.direction = extrusionDirection as Bit.Inputs.Base.Point3;\n // Distance to offset the wire\n offset3DOpt.offset = offsetDistance;\n \n const offset3DWire = await operations.offset3DWire(offset3DOpt);\n\n // Draw both the original and offset wires with different colors for comparison\n const originalOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n originalOptions.edgeWidth = 4;\n originalOptions.edgeColour = \"#00ff00\"; // Green for original\n \n const offsetOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offsetOptions.edgeWidth = 4;\n offsetOptions.edgeColour = \"#ff0000\"; // Red for offset\n \n bitbybit.draw.drawAnyAsync({ entity: curvedWire, options: originalOptions });\n bitbybit.draw.drawAnyAsync({ entity: offset3DWire, options: offsetOptions });\n\n}\n\nstart();","version":"0.21.0","type":"typescript"}} title="3D Wire Offset Operation" /> diff --git a/docs/learn/code/common/occt/operations/rotated-extrusions.md b/docs/learn/code/common/occt/operations/rotated-extrusions.md index 0936ff6c..622ea449 100644 --- a/docs/learn/code/common/occt/operations/rotated-extrusions.md +++ b/docs/learn/code/common/occt/operations/rotated-extrusions.md @@ -34,21 +34,21 @@ In the examples below, we will demonstrate how to create a simple solid 3D helic 130000104360TRUE","version":"0.20.14","type":"blockly"}} + script={{"script":"130000104360TRUE","version":"0.21.0","type":"blockly"}} title="Extrude the wire into shell kind of shape" /> {\n\n const recOpt = new Bit.Inputs.OCCT.RectangleDto(1, 3);\n const rectangle = await bitbybit.occt.shapes.wire.createRectangleWire(recOpt);\n const rotatedExtrudeOpt = new Bit.Inputs.OCCT.RotationExtrudeDto(rectangle, 4);\n const rotatedExtrude = await bitbybit.occt.operations.rotatedExtrude(rotatedExtrudeOpt)\n\n bitbybit.draw.drawAnyAsync({ entity: rotatedExtrude });\n\n}\n\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = async () => {\n\n const recOpt = new Bit.Inputs.OCCT.RectangleDto(1, 3);\n const rectangle = await bitbybit.occt.shapes.wire.createRectangleWire(recOpt);\n const rotatedExtrudeOpt = new Bit.Inputs.OCCT.RotationExtrudeDto(rectangle, 4);\n const rotatedExtrude = await bitbybit.occt.operations.rotatedExtrude(rotatedExtrudeOpt)\n\n bitbybit.draw.drawAnyAsync({ entity: rotatedExtrude });\n\n}\n\nstart();","version":"0.21.0","type":"typescript"}} title="Extrude the wire into shell kind of shape" /> @@ -62,21 +62,21 @@ When the profile is further from the center it will form a helix like shape. Thi pointPromisespointsngonRotationPromisesi3050300150117910001000100010003pointPromises00001061012FALSETRUEpointspointPromisesngonRotationPromisesipointsINSERTLASTngonRotationPromisesi01061.530270TRUEngonRotationPromises","version":"0.20.14","type":"blockly"}} + script={{"script":"pointPromisespointsngonRotationPromisesi3050300150117910001000100010003pointPromises00001061012FALSETRUEpointspointPromisesngonRotationPromisesipointsINSERTLASTngonRotationPromisesi01061.530270TRUEngonRotationPromises","version":"0.21.0","type":"blockly"}} title="Extrude the wire into shell kind of shape" /> {\n\n // Adjust the default camera position to face the object\n const cameraOptions = new CameraConfigurationDto();\n cameraOptions.position = [30, 50, 50];\n cameraOptions.lookAt = [0, 15, 0];\n scene.adjustActiveArcRotateCamera(cameraOptions);\n\n // This ellipse will be used to derive origins for ngons on the ground plane\n const ellipseOptions = new EllipseDto();\n ellipseOptions.radiusMinor = 6;\n ellipseOptions.radiusMajor = 10;\n const ellipse = await wire.createEllipseWire(ellipseOptions);\n\n // We divide the wire into 12 segments and return the points\n const divideOptions = new DivideDto(ellipse);\n divideOptions.removeEndPoint = true;\n divideOptions.nrOfDivisions = 12;\n const points = await wire.divideWireByEqualDistanceToPoints(divideOptions);\n\n // Create ngons on these points\n const ngonOptions = new NGonWireDto();\n ngonOptions.radius = 1.5;\n const ngonPromises = points.map(point => {\n ngonOptions.center = point;\n return wire.createNGonWire(ngonOptions);\n });\n\n const ngons = await Promise.all(ngonPromises);\n\n // Form rotated extrusions on all of the points\n const rotatedExtrudeOptions = new RotationExtrudeDto();\n rotatedExtrudeOptions.angle = 270;\n rotatedExtrudeOptions.height = 30;\n const rotatedExtrusionPromises = ngons.map(ngon => {\n rotatedExtrudeOptions.shape = ngon;\n return operations.rotatedExtrude(rotatedExtrudeOptions);\n });\n\n const rotatedExtrusions = await Promise.all(rotatedExtrusionPromises);\n\n // Compounding multiple shapes will generally deliver much better rendering performance\n // as it will form a single mesh for all of the geometries involved in compound\n const compoundOptions = new CompoundShapesDto(rotatedExtrusions);\n const ngonCompound = await compound.makeCompound(compoundOptions);\n\n // As a last step we draw the ngon with default occt settings (defualt because we omit specifying options property)\n bitbybit.draw.drawAnyAsync({ entity: ngonCompound });\n\n}\n\n// Let's not forget to execute the start function, otherwise nothing will happen.\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// These destructured imports are optional, but convenient later on - option DTO's are classes\nconst { EllipseDto, RotationExtrudeDto, DivideDto, NGonWireDto, CompoundShapesDto } = Bit.Inputs.OCCT;\nconst { CameraConfigurationDto } = Bit.Inputs.BabylonScene;\n// These are parts of the bitbybit API that will be used in the script\nconst { wire, compound } = bitbybit.occt.shapes;\nconst { operations } = bitbybit.occt;\nconst { scene } = bitbybit.babylon;\n// Types need to be destructured one by one\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\n\n// Async definition of the start function where we can await on asynchronous CAD algorithms running inside the web workers\nconst start = async () => {\n\n // Adjust the default camera position to face the object\n const cameraOptions = new CameraConfigurationDto();\n cameraOptions.position = [30, 50, 50];\n cameraOptions.lookAt = [0, 15, 0];\n scene.adjustActiveArcRotateCamera(cameraOptions);\n\n // This ellipse will be used to derive origins for ngons on the ground plane\n const ellipseOptions = new EllipseDto();\n ellipseOptions.radiusMinor = 6;\n ellipseOptions.radiusMajor = 10;\n const ellipse = await wire.createEllipseWire(ellipseOptions);\n\n // We divide the wire into 12 segments and return the points\n const divideOptions = new DivideDto(ellipse);\n divideOptions.removeEndPoint = true;\n divideOptions.nrOfDivisions = 12;\n const points = await wire.divideWireByEqualDistanceToPoints(divideOptions);\n\n // Create ngons on these points\n const ngonOptions = new NGonWireDto();\n ngonOptions.radius = 1.5;\n const ngonPromises = points.map(point => {\n ngonOptions.center = point;\n return wire.createNGonWire(ngonOptions);\n });\n\n const ngons = await Promise.all(ngonPromises);\n\n // Form rotated extrusions on all of the points\n const rotatedExtrudeOptions = new RotationExtrudeDto();\n rotatedExtrudeOptions.angle = 270;\n rotatedExtrudeOptions.height = 30;\n const rotatedExtrusionPromises = ngons.map(ngon => {\n rotatedExtrudeOptions.shape = ngon;\n return operations.rotatedExtrude(rotatedExtrudeOptions);\n });\n\n const rotatedExtrusions = await Promise.all(rotatedExtrusionPromises);\n\n // Compounding multiple shapes will generally deliver much better rendering performance\n // as it will form a single mesh for all of the geometries involved in compound\n const compoundOptions = new CompoundShapesDto(rotatedExtrusions);\n const ngonCompound = await compound.makeCompound(compoundOptions);\n\n // As a last step we draw the ngon with default occt settings (defualt because we omit specifying options property)\n bitbybit.draw.drawAnyAsync({ entity: ngonCompound });\n\n}\n\n// Let's not forget to execute the start function, otherwise nothing will happen.\nstart();","version":"0.21.0","type":"typescript"}} title="Extrude the wire into shell kind of shape" /> diff --git a/docs/learn/code/common/occt/operations/simple-loft.md b/docs/learn/code/common/occt/operations/simple-loft.md index d37c06de..9dca8132 100644 --- a/docs/learn/code/common/occt/operations/simple-loft.md +++ b/docs/learn/code/common/occt/operations/simple-loft.md @@ -37,21 +37,21 @@ In this tutorial, we'll walk through the process of creating a simple lofted sha ellipse1ellipse2ellipse3ellipsesloftellipse100001048ellipse203001014ellipse307001026ellipsesellipse1ellipse2ellipse3loftellipsesFALSEloft0.001TRUE#6600ccTRUE#ffffff2","version":"0.20.14","type":"blockly"}} + script={{"script":"ellipse1ellipse2ellipse3ellipsesloftellipse100001048ellipse203001014ellipse307001026ellipsesellipse1ellipse2ellipse3loftellipsesFALSEloft0.001TRUE#6600ccTRUE#ffffff2","version":"0.21.0","type":"blockly"}} title="Simple Loft Operation" /> {\n\n // Create an instance of EllipseDto to define the properties of the first ellipse.\n const ellipseOpt = new EllipseDto();\n // Set the minor radius of the ellipse.\n ellipseOpt.radiusMinor = 4;\n // Set the major radius of the ellipse.\n ellipseOpt.radiusMajor = 8;\n // Create the first elliptical wire. The center defaults to [0,0,0] and direction to [0,1,0] if not specified.\n // 'await' is used because shape creation is an asynchronous operation.\n const ellipse1 = await shapes.wire.createEllipseWire(ellipseOpt);\n\n // Modify the ellipseOpt for the second ellipse.\n // Set the center of the second ellipse.\n ellipseOpt.center = [0, 3, 0];\n // Set the minor radius for the second ellipse.\n ellipseOpt.radiusMinor = 1;\n // Set the major radius for the second ellipse.\n ellipseOpt.radiusMajor = 4;\n // Create the second elliptical wire with the updated options.\n const ellipse2 = await shapes.wire.createEllipseWire(ellipseOpt);\n\n // Modify the ellipseOpt for the third ellipse.\n // Set the center of the third ellipse.\n ellipseOpt.center = [0, 7, 0];\n // Set the minor radius for the third ellipse.\n ellipseOpt.radiusMinor = 2;\n // Set the major radius for the third ellipse.\n ellipseOpt.radiusMajor = 6;\n // Create the third elliptical wire with the updated options.\n const ellipse3 = await shapes.wire.createEllipseWire(ellipseOpt);\n\n // Create an instance of LoftDto to define the parameters for the loft operation.\n // The generic type TopoDSShapePointer indicates the type of shapes to be lofted.\n const loftOpt = new LoftDto();\n // Assign an array of the created ellipse wires to the 'shapes' property of loftOpt.\n // These are the profiles that will be connected by the loft.\n loftOpt.shapes = [ellipse1, ellipse2, ellipse3];\n // Perform the loft operation using the defined options.\n // This will create a surface (or shell) connecting the three ellipses.\n // 'makeSolid' defaults to false, creating a shell.\n const loft = await operations.loft(loftOpt);\n\n // Create an instance of DrawOcctShapeSimpleOptions to define how the lofted shape will be displayed.\n const drawOpt = new DrawOcctShapeSimpleOptions();\n // Set the precision for drawing the shape. This affects the tessellation quality.\n drawOpt.precision = 0.001;\n // Set the color of the faces of the lofted shape.\n drawOpt.faceColour = \"#ff00ff\"; // Magenta\n // Draw the lofted shape asynchronously using the specified entity and drawing options.\n draw.drawAnyAsync({ entity: loft, options: drawOpt });\n\n}\n\n// Call the start function to execute the script.\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import necessary modules from the bitbybit library.\n// 'operations' and 'shapes' are for OpenCascade Technology (OCCT) functionalities like lofting and creating wires.\nconst { operations, shapes } = bitbybit.occt;\n// 'draw' module is used for rendering shapes on the canvas.\nconst { draw } = bitbybit;\n// Import Data Transfer Objects (DTOs) for defining OCCT inputs.\n// 'EllipseDto' for creating ellipses, 'LoftDto' for loft operation parameters.\nconst { EllipseDto, LoftDto } = Bit.Inputs.OCCT;\n// Import DTO for drawing options.\nconst { DrawOcctShapeSimpleOptions } = Bit.Inputs.Draw;\n// Define a type alias for OCCT shape pointers for better readability.\ntype TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer;\n\n// Define an asynchronous function 'start' which will contain the main logic.\nconst start = async () => {\n\n // Create an instance of EllipseDto to define the properties of the first ellipse.\n const ellipseOpt = new EllipseDto();\n // Set the minor radius of the ellipse.\n ellipseOpt.radiusMinor = 4;\n // Set the major radius of the ellipse.\n ellipseOpt.radiusMajor = 8;\n // Create the first elliptical wire. The center defaults to [0,0,0] and direction to [0,1,0] if not specified.\n // 'await' is used because shape creation is an asynchronous operation.\n const ellipse1 = await shapes.wire.createEllipseWire(ellipseOpt);\n\n // Modify the ellipseOpt for the second ellipse.\n // Set the center of the second ellipse.\n ellipseOpt.center = [0, 3, 0];\n // Set the minor radius for the second ellipse.\n ellipseOpt.radiusMinor = 1;\n // Set the major radius for the second ellipse.\n ellipseOpt.radiusMajor = 4;\n // Create the second elliptical wire with the updated options.\n const ellipse2 = await shapes.wire.createEllipseWire(ellipseOpt);\n\n // Modify the ellipseOpt for the third ellipse.\n // Set the center of the third ellipse.\n ellipseOpt.center = [0, 7, 0];\n // Set the minor radius for the third ellipse.\n ellipseOpt.radiusMinor = 2;\n // Set the major radius for the third ellipse.\n ellipseOpt.radiusMajor = 6;\n // Create the third elliptical wire with the updated options.\n const ellipse3 = await shapes.wire.createEllipseWire(ellipseOpt);\n\n // Create an instance of LoftDto to define the parameters for the loft operation.\n // The generic type TopoDSShapePointer indicates the type of shapes to be lofted.\n const loftOpt = new LoftDto();\n // Assign an array of the created ellipse wires to the 'shapes' property of loftOpt.\n // These are the profiles that will be connected by the loft.\n loftOpt.shapes = [ellipse1, ellipse2, ellipse3];\n // Perform the loft operation using the defined options.\n // This will create a surface (or shell) connecting the three ellipses.\n // 'makeSolid' defaults to false, creating a shell.\n const loft = await operations.loft(loftOpt);\n\n // Create an instance of DrawOcctShapeSimpleOptions to define how the lofted shape will be displayed.\n const drawOpt = new DrawOcctShapeSimpleOptions();\n // Set the precision for drawing the shape. This affects the tessellation quality.\n drawOpt.precision = 0.001;\n // Set the color of the faces of the lofted shape.\n drawOpt.faceColour = \"#ff00ff\"; // Magenta\n // Draw the lofted shape asynchronously using the specified entity and drawing options.\n draw.drawAnyAsync({ entity: loft, options: drawOpt });\n\n}\n\n// Call the start function to execute the script.\nstart();","version":"0.21.0","type":"typescript"}} title="Simple Loft Operation" /> diff --git a/docs/learn/code/common/occt/operations/thick-solids.md b/docs/learn/code/common/occt/operations/thick-solids.md index 38fa01ec..676a080d 100644 --- a/docs/learn/code/common/occt/operations/thick-solids.md +++ b/docs/learn/code/common/occt/operations/thick-solids.md @@ -63,21 +63,21 @@ The following examples demonstrate creating thick solids from complex lofted sur bottomPointsmiddlePointstopPointsbottomWiremiddleWiretopWirewireListloftSurfacethickSolidtranslatedSolidthicknessoffsetVectorsurfaceOptionssolidOptionsbottomPoints-30-2-10000110030-2middlePoints-22-1-0.521.50220.521.522-1topPoints-1.540-0.540.50410.540.51.540bottomWirebottomPointsFALSE0.1middleWiremiddlePointsFALSE0.1topWiretopPointsFALSE0.1wireListbottomWiremiddleWiretopWireloftSurfacewireListFALSEthickness0.1thickSolidloftSurfacethicknessoffsetVector003translatedSolidthickSolidoffsetVectorsurfaceOptions0.01TRUE#00ff00TRUE#ffffff2solidOptions0.01TRUE#ff6600TRUE#ffffff2loftSurfacesurfaceOptionstranslatedSolidsolidOptions","version":"0.20.14","type":"blockly"}} + script={{"script":"bottomPointsmiddlePointstopPointsbottomWiremiddleWiretopWirewireListloftSurfacethickSolidtranslatedSolidthicknessoffsetVectorsurfaceOptionssolidOptionsbottomPoints-30-2-10000110030-2middlePoints-22-1-0.521.50220.521.522-1topPoints-1.540-0.540.50410.540.51.540bottomWirebottomPointsFALSE0.1middleWiremiddlePointsFALSE0.1topWiretopPointsFALSE0.1wireListbottomWiremiddleWiretopWireloftSurfacewireListFALSEthickness0.1thickSolidloftSurfacethicknessoffsetVector003translatedSolidthickSolidoffsetVectorsurfaceOptions0.01TRUE#00ff00TRUE#ffffff2solidOptions0.01TRUE#ff6600TRUE#ffffff2loftSurfacesurfaceOptionstranslatedSolidsolidOptions","version":"0.21.0","type":"blockly"}} title="Thick Solid from Lofted Surface (Blockly)" /> {\n\n // Define points for bottom curve (wave-like pattern)\n const bottomPoints = [\n [-3, 0, -2],\n [-1, 0, 0],\n [0, 0, 1],\n [1, 0, 0],\n [3, 0, -2]\n ] as Point3[];\n\n // Define points for middle curve (elevated and more curved)\n const middlePoints = [\n [-2, 2, -1],\n [-0.5, 2, 1.5],\n [0, 2, 2],\n [0.5, 2, 1.5],\n [2, 2, -1]\n ] as Point3[];\n\n // Define points for top curve (simpler, less curved)\n const topPoints = [\n [-1.5, 4, 0],\n [-0.5, 4, 0.5],\n [0, 4, 1],\n [0.5, 4, 0.5],\n [1.5, 4, 0]\n ] as Point3[];\n\n // Create interpolated wires from points\n const bottomWireOpt = new InterpolationDto();\n bottomWireOpt.points = bottomPoints;\n bottomWireOpt.periodic = false;\n bottomWireOpt.tolerance = 0.1;\n const bottomWire = await wire.interpolatePoints(bottomWireOpt);\n\n const middleWireOpt = new InterpolationDto();\n middleWireOpt.points = middlePoints;\n middleWireOpt.periodic = false;\n middleWireOpt.tolerance = 0.1;\n const middleWire = await wire.interpolatePoints(middleWireOpt);\n\n const topWireOpt = new InterpolationDto();\n topWireOpt.points = topPoints;\n topWireOpt.periodic = false;\n topWireOpt.tolerance = 0.1;\n const topWire = await wire.interpolatePoints(topWireOpt);\n\n // Create lofted surface from the three wires\n const loftOpt = new LoftDto();\n loftOpt.shapes = [bottomWire, middleWire, topWire];\n loftOpt.makeSolid = false;\n const loftSurface = await operations.loft(loftOpt);\n\n // Create thick solid from the lofted surface\n const thickness = 0.1;\n const thickSolidOpt = new ThisckSolidSimpleDto();\n thickSolidOpt.shape = loftSurface;\n thickSolidOpt.offset = thickness;\n const thickSolid = await operations.makeThickSolidSimple(thickSolidOpt);\n\n // Translate the thick solid for better visualization\n const offsetVector = [0, 0, 3] as Vector3;\n const translateOpt = new TranslateDto();\n translateOpt.shape = thickSolid;\n translateOpt.translation = offsetVector;\n const translatedSolid = await transforms.translate(translateOpt);\n\n // Create drawing options for the original surface (green)\n const surfaceOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n surfaceOptions.precision = 0.01;\n surfaceOptions.drawFaces = true;\n surfaceOptions.faceColour = \"#00ff00\";\n surfaceOptions.drawEdges = true;\n surfaceOptions.edgeColour = \"#ffffff\";\n surfaceOptions.edgeWidth = 2;\n\n // Create drawing options for the thick solid (orange)\n const solidOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n solidOptions.precision = 0.01;\n solidOptions.drawFaces = true;\n solidOptions.faceColour = \"#ff6600\";\n solidOptions.drawEdges = true;\n solidOptions.edgeColour = \"#ffffff\";\n solidOptions.edgeWidth = 2;\n\n // Draw both the original lofted surface and the thick solid\n bitbybit.draw.drawAnyAsync({ entity: loftSurface, options: surfaceOptions });\n bitbybit.draw.drawAnyAsync({ entity: translatedSolid, options: solidOptions });\n\n}\n\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required modules from global bitbybit variable\nconst { wire } = bitbybit.occt.shapes;\nconst { operations } = bitbybit.occt;\nconst { transforms } = bitbybit.occt;\n\nconst { InterpolationDto, LoftDto, ThisckSolidSimpleDto, TranslateDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Define a type alias for pointers\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer;\n\nconst start = async () => {\n\n // Define points for bottom curve (wave-like pattern)\n const bottomPoints = [\n [-3, 0, -2],\n [-1, 0, 0],\n [0, 0, 1],\n [1, 0, 0],\n [3, 0, -2]\n ] as Point3[];\n\n // Define points for middle curve (elevated and more curved)\n const middlePoints = [\n [-2, 2, -1],\n [-0.5, 2, 1.5],\n [0, 2, 2],\n [0.5, 2, 1.5],\n [2, 2, -1]\n ] as Point3[];\n\n // Define points for top curve (simpler, less curved)\n const topPoints = [\n [-1.5, 4, 0],\n [-0.5, 4, 0.5],\n [0, 4, 1],\n [0.5, 4, 0.5],\n [1.5, 4, 0]\n ] as Point3[];\n\n // Create interpolated wires from points\n const bottomWireOpt = new InterpolationDto();\n bottomWireOpt.points = bottomPoints;\n bottomWireOpt.periodic = false;\n bottomWireOpt.tolerance = 0.1;\n const bottomWire = await wire.interpolatePoints(bottomWireOpt);\n\n const middleWireOpt = new InterpolationDto();\n middleWireOpt.points = middlePoints;\n middleWireOpt.periodic = false;\n middleWireOpt.tolerance = 0.1;\n const middleWire = await wire.interpolatePoints(middleWireOpt);\n\n const topWireOpt = new InterpolationDto();\n topWireOpt.points = topPoints;\n topWireOpt.periodic = false;\n topWireOpt.tolerance = 0.1;\n const topWire = await wire.interpolatePoints(topWireOpt);\n\n // Create lofted surface from the three wires\n const loftOpt = new LoftDto();\n loftOpt.shapes = [bottomWire, middleWire, topWire];\n loftOpt.makeSolid = false;\n const loftSurface = await operations.loft(loftOpt);\n\n // Create thick solid from the lofted surface\n const thickness = 0.1;\n const thickSolidOpt = new ThisckSolidSimpleDto();\n thickSolidOpt.shape = loftSurface;\n thickSolidOpt.offset = thickness;\n const thickSolid = await operations.makeThickSolidSimple(thickSolidOpt);\n\n // Translate the thick solid for better visualization\n const offsetVector = [0, 0, 3] as Vector3;\n const translateOpt = new TranslateDto();\n translateOpt.shape = thickSolid;\n translateOpt.translation = offsetVector;\n const translatedSolid = await transforms.translate(translateOpt);\n\n // Create drawing options for the original surface (green)\n const surfaceOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n surfaceOptions.precision = 0.01;\n surfaceOptions.drawFaces = true;\n surfaceOptions.faceColour = \"#00ff00\";\n surfaceOptions.drawEdges = true;\n surfaceOptions.edgeColour = \"#ffffff\";\n surfaceOptions.edgeWidth = 2;\n\n // Create drawing options for the thick solid (orange)\n const solidOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n solidOptions.precision = 0.01;\n solidOptions.drawFaces = true;\n solidOptions.faceColour = \"#ff6600\";\n solidOptions.drawEdges = true;\n solidOptions.edgeColour = \"#ffffff\";\n solidOptions.edgeWidth = 2;\n\n // Draw both the original lofted surface and the thick solid\n bitbybit.draw.drawAnyAsync({ entity: loftSurface, options: surfaceOptions });\n bitbybit.draw.drawAnyAsync({ entity: translatedSolid, options: solidOptions });\n\n}\n\nstart();","version":"0.21.0","type":"typescript"}} title="Thick Solid from Lofted Surface" /> diff --git a/docs/learn/code/common/occt/operations/wire-offset-multiple.md b/docs/learn/code/common/occt/operations/wire-offset-multiple.md index a55f8311..f6daecab 100644 --- a/docs/learn/code/common/occt/operations/wire-offset-multiple.md +++ b/docs/learn/code/common/occt/operations/wire-offset-multiple.md @@ -31,7 +31,7 @@ The following example demonstrates creating multiple offset curves from a single @@ -39,7 +39,7 @@ The following example demonstrates creating multiple offset curves from a single controlPointsbaseWirestepoverDistanceoffset1offset2offset3baseStyleoffset1Styleoffset2Styleoffset3StylecontrolPoints-40-2-202001203400stepoverDistance0.5baseWirecontrolPointsFALSE0.01offset1baseWirestepoverDistance0.01offset2baseWireMULTIPLYstepoverDistance20.01offset3baseWireMULTIPLYstepoverDistance30.01baseStyle0.01FALSETRUE#00ff004offset1Style0.01FALSETRUE#ff99003offset2Style0.01FALSETRUE#ff66003offset3Style0.01FALSETRUE#ff33003baseWirebaseStyleoffset1offset1Styleoffset2offset2Styleoffset3offset3Style","version":"0.20.14","type":"blockly"}} + script={{"script":"controlPointsbaseWirestepoverDistanceoffset1offset2offset3baseStyleoffset1Styleoffset2Styleoffset3StylecontrolPoints-40-2-202001203400stepoverDistance0.5baseWirecontrolPointsFALSE0.01offset1baseWirestepoverDistance0.01offset2baseWireMULTIPLYstepoverDistance20.01offset3baseWireMULTIPLYstepoverDistance30.01baseStyle0.01FALSETRUE#00ff004offset1Style0.01FALSETRUE#ff99003offset2Style0.01FALSETRUE#ff66003offset3Style0.01FALSETRUE#ff33003baseWirebaseStyleoffset1offset1Styleoffset2offset2Styleoffset3offset3Style","version":"0.21.0","type":"blockly"}} title="Multiple Wire Offsets" /> @@ -47,7 +47,7 @@ The following example demonstrates creating multiple offset curves from a single {\n\n // Define the stepover distance for CNC toolpaths\n const stepoverDistance = 0.5;\n\n // Step 1: Define control points for the base toolpath\n const points = [\n [-4, 0, -2],\n [-2, 0, 2],\n [0, 0, 1],\n [2, 0, 3],\n [4, 0, 0]\n ] as Point3[];\n\n // Step 2: Create base wire through interpolation\n const interpolationOpt = new InterpolationDto();\n interpolationOpt.points = points;\n interpolationOpt.periodic = false;\n interpolationOpt.tolerance = 0.01;\n \n const baseWire = await wire.interpolatePoints(interpolationOpt);\n\n // Step 3: Create multiple offset toolpaths\n // First offset\n const offset1Opt = new OffsetDto();\n offset1Opt.shape = baseWire;\n offset1Opt.distance = stepoverDistance;\n offset1Opt.tolerance = 0.01;\n \n const offset1 = await operations.offset(offset1Opt);\n\n // Second offset\n const offset2Opt = new OffsetDto();\n offset2Opt.shape = baseWire;\n offset2Opt.distance = stepoverDistance * 2;\n offset2Opt.tolerance = 0.01;\n \n const offset2 = await operations.offset(offset2Opt);\n\n // Third offset\n const offset3Opt = new OffsetDto();\n offset3Opt.shape = baseWire;\n offset3Opt.distance = stepoverDistance * 3;\n offset3Opt.tolerance = 0.01;\n \n const offset3 = await operations.offset(offset3Opt);\n\n // Step 4: Visualize all toolpaths with different colors\n // Base wire (green - reference path)\n const baseOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n baseOptions.edgeWidth = 4;\n baseOptions.edgeColour = \"#00ff00\"; // Green\n baseOptions.drawFaces = false;\n \n // Offset 1 (orange)\n const offset1Options = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offset1Options.edgeWidth = 3;\n offset1Options.edgeColour = \"#ff9900\"; // Orange\n offset1Options.drawFaces = false;\n \n // Offset 2 (red-orange)\n const offset2Options = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offset2Options.edgeWidth = 3;\n offset2Options.edgeColour = \"#ff6600\"; // Red-orange\n offset2Options.drawFaces = false;\n \n // Offset 3 (red)\n const offset3Options = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offset3Options.edgeWidth = 3;\n offset3Options.edgeColour = \"#ff3300\"; // Red\n offset3Options.drawFaces = false;\n \n // Draw all toolpaths\n bitbybit.draw.drawAnyAsync({ entity: baseWire, options: baseOptions });\n bitbybit.draw.drawAnyAsync({ entity: offset1, options: offset1Options });\n bitbybit.draw.drawAnyAsync({ entity: offset2, options: offset2Options });\n bitbybit.draw.drawAnyAsync({ entity: offset3, options: offset3Options });\n\n}\n\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required modules for wire creation and operations\nconst { wire } = bitbybit.occt.shapes;\nconst { operations } = bitbybit.occt;\n// Import DTOs for interpolation and offset operations\nconst { InterpolationDto, OffsetDto } = Bit.Inputs.OCCT;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype Point3 = Bit.Inputs.Base.Point3;\n\nconst start = async () => {\n\n // Define the stepover distance for CNC toolpaths\n const stepoverDistance = 0.5;\n\n // Step 1: Define control points for the base toolpath\n const points = [\n [-4, 0, -2],\n [-2, 0, 2],\n [0, 0, 1],\n [2, 0, 3],\n [4, 0, 0]\n ] as Point3[];\n\n // Step 2: Create base wire through interpolation\n const interpolationOpt = new InterpolationDto();\n interpolationOpt.points = points;\n interpolationOpt.periodic = false;\n interpolationOpt.tolerance = 0.01;\n \n const baseWire = await wire.interpolatePoints(interpolationOpt);\n\n // Step 3: Create multiple offset toolpaths\n // First offset\n const offset1Opt = new OffsetDto();\n offset1Opt.shape = baseWire;\n offset1Opt.distance = stepoverDistance;\n offset1Opt.tolerance = 0.01;\n \n const offset1 = await operations.offset(offset1Opt);\n\n // Second offset\n const offset2Opt = new OffsetDto();\n offset2Opt.shape = baseWire;\n offset2Opt.distance = stepoverDistance * 2;\n offset2Opt.tolerance = 0.01;\n \n const offset2 = await operations.offset(offset2Opt);\n\n // Third offset\n const offset3Opt = new OffsetDto();\n offset3Opt.shape = baseWire;\n offset3Opt.distance = stepoverDistance * 3;\n offset3Opt.tolerance = 0.01;\n \n const offset3 = await operations.offset(offset3Opt);\n\n // Step 4: Visualize all toolpaths with different colors\n // Base wire (green - reference path)\n const baseOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n baseOptions.edgeWidth = 4;\n baseOptions.edgeColour = \"#00ff00\"; // Green\n baseOptions.drawFaces = false;\n \n // Offset 1 (orange)\n const offset1Options = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offset1Options.edgeWidth = 3;\n offset1Options.edgeColour = \"#ff9900\"; // Orange\n offset1Options.drawFaces = false;\n \n // Offset 2 (red-orange)\n const offset2Options = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offset2Options.edgeWidth = 3;\n offset2Options.edgeColour = \"#ff6600\"; // Red-orange\n offset2Options.drawFaces = false;\n \n // Offset 3 (red)\n const offset3Options = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offset3Options.edgeWidth = 3;\n offset3Options.edgeColour = \"#ff3300\"; // Red\n offset3Options.drawFaces = false;\n \n // Draw all toolpaths\n bitbybit.draw.drawAnyAsync({ entity: baseWire, options: baseOptions });\n bitbybit.draw.drawAnyAsync({ entity: offset1, options: offset1Options });\n bitbybit.draw.drawAnyAsync({ entity: offset2, options: offset2Options });\n bitbybit.draw.drawAnyAsync({ entity: offset3, options: offset3Options });\n\n}\n\nstart();","version":"0.21.0","type":"typescript"}} title="Multiple Wire Offsets" /> diff --git a/docs/learn/code/common/occt/shapes/compound/compounded-drawing.md b/docs/learn/code/common/occt/shapes/compound/compounded-drawing.md index 719c2a2f..4c65c2ae 100644 --- a/docs/learn/code/common/occt/shapes/compound/compounded-drawing.md +++ b/docs/learn/code/common/occt/shapes/compound/compounded-drawing.md @@ -40,21 +40,21 @@ The example below demonstrates this principle through a complex workflow that cr bottomPointsmiddlePointstopPointsbottomWiremiddleWiretopWirewiresListloftedSurfacemainFacenrHexagonsUnrHexagonsVscalePatternhexWires1hexWires2reversedWiresiframesfirstFramesCompoundsecondFramesCompoundmaterial1material2bottomPoints[[-30, 0, -20], [-10, 0, 0], [0, 0, 10], [10, 0, 0],[30, 0, -20]]middlePoints[[-20, 20, -10], [-5, 20, 15], [0, 20, 20], [5, 20, 15],[20, 20, -10]]topPoints[[-15, 30, 0], [-5, 30, 5], [0, 30, 10], [5, 30, 5],[15, 30, 0]]bottomWirebottomPointsFALSE0.1middleWiremiddlePointsFALSE0.1topWiretopPointsFALSE0.1wiresListbottomWiremiddleWiretopWireloftedSurfacewiresListFALSEmainFaceloftedSurface0nrHexagonsU28nrHexagonsV10scalePattern0.7hexWires1mainFacenrHexagonsUnrHexagonsVFALSE00FALSEFALSEFALSEFALSEhexWires2mainFacenrHexagonsUnrHexagonsVFALSEscalePatternscalePattern00FALSEFALSEFALSEFALSEreversedWiresi1hexWires21INSERTLASTreversedWiresGETFROM_STARThexWires2iframesi1hexWires11INSERTLASTframesGETFROM_STARThexWires1iGETFROM_STARTreversedWiresiFALSEfirstFramesCompoundframes[true, true, false]secondFramesCompoundframes[false,false,true]material1First#9155ff#0000000.150.91FALSE3material2Second#000000#0000000.90.151FALSE3firstFramesCompound0.01material1TRUE#00000010secondFramesCompound0.01material2TRUE#00000010-100-100-1003#ffffff#ffffff1024TRUE0TRUE0.20.00010.00210000'default'10000.10.7TRUE442244015011791000100010001000340040010100.450.50.5FALSE#ffffff#ffffff#050506#627a9d'to top'0100","version":"0.20.14","type":"blockly"}} + script={{"script":"bottomPointsmiddlePointstopPointsbottomWiremiddleWiretopWirewiresListloftedSurfacemainFacenrHexagonsUnrHexagonsVscalePatternhexWires1hexWires2reversedWiresiframesfirstFramesCompoundsecondFramesCompoundmaterial1material2bottomPoints[[-30, 0, -20], [-10, 0, 0], [0, 0, 10], [10, 0, 0],[30, 0, -20]]middlePoints[[-20, 20, -10], [-5, 20, 15], [0, 20, 20], [5, 20, 15],[20, 20, -10]]topPoints[[-15, 30, 0], [-5, 30, 5], [0, 30, 10], [5, 30, 5],[15, 30, 0]]bottomWirebottomPointsFALSE0.1middleWiremiddlePointsFALSE0.1topWiretopPointsFALSE0.1wiresListbottomWiremiddleWiretopWireloftedSurfacewiresListFALSEmainFaceloftedSurface0nrHexagonsU28nrHexagonsV10scalePattern0.7hexWires1mainFacenrHexagonsUnrHexagonsVFALSE00FALSEFALSEFALSEFALSEhexWires2mainFacenrHexagonsUnrHexagonsVFALSEscalePatternscalePattern00FALSEFALSEFALSEFALSEreversedWiresi1hexWires21INSERTLASTreversedWiresGETFROM_STARThexWires2iframesi1hexWires11INSERTLASTframesGETFROM_STARThexWires1iGETFROM_STARTreversedWiresiFALSEfirstFramesCompoundframes[true, true, false]secondFramesCompoundframes[false,false,true]material1First#9155ff#0000000.150.91FALSE3material2Second#000000#0000000.90.151FALSE3firstFramesCompound0.01material1TRUE#00000010secondFramesCompound0.01material2TRUE#00000010-100-100-1003#ffffff#ffffff1024TRUE0TRUE0.20.00010.00210000'default'10000.10.7TRUE442244015011791000100010001000340040010100.450.50.5FALSE#ffffff#ffffff#050506#627a9d'to top'0100","version":"0.21.0","type":"blockly"}} title="Compounding hex frames into single entity will render faster" /> {\n // Define point sets for three different wire levels\n const bottomPoints: Point3[] = [\n [-30, 0, -20],\n [-10, 0, 0],\n [0, 0, 10],\n [10, 0, 0],\n [30, 0, -20]\n ];\n\n const middlePoints: Point3[] = [\n [-20, 20, -10],\n [-5, 20, 15],\n [0, 20, 20],\n [5, 20, 15],\n [20, 20, -10]\n ];\n\n const topPoints: Point3[] = [\n [-15, 30, 0],\n [-5, 30, 5],\n [0, 30, 10],\n [5, 30, 5],\n [15, 30, 0]\n ];\n\n // Create wires by interpolating points\n const bottomWireOptions = new InterpolationDto();\n bottomWireOptions.points = bottomPoints;\n bottomWireOptions.periodic = false;\n bottomWireOptions.tolerance = 0.1;\n const bottomWire = await wire.interpolatePoints(bottomWireOptions);\n\n const middleWireOptions = new InterpolationDto();\n middleWireOptions.points = middlePoints;\n middleWireOptions.periodic = false;\n middleWireOptions.tolerance = 0.1;\n const middleWire = await wire.interpolatePoints(middleWireOptions);\n\n const topWireOptions = new InterpolationDto();\n topWireOptions.points = topPoints;\n topWireOptions.periodic = false;\n topWireOptions.tolerance = 0.1;\n const topWire = await wire.interpolatePoints(topWireOptions);\n\n // Create list of wires for lofting\n const wiresList = [bottomWire, middleWire, topWire];\n\n // Loft the wires to create a surface\n const loftOptions = new LoftDto();\n loftOptions.shapes = wiresList;\n loftOptions.makeSolid = false;\n const loftedSurface = await operations.loft(loftOptions);\n\n // Get the face from the lofted surface\n const getFaceOptions = new ShapeIndexDto();\n getFaceOptions.shape = loftedSurface;\n getFaceOptions.index = 0;\n const mainFace = await face.getFace(getFaceOptions);\n\n // Subdivision parameters\n const nrHexagonsU = 28;\n const nrHexagonsV = 10;\n const scalePattern = [0.7];\n\n // Create first hexagon subdivision (regular pattern)\n const hexSubdivision1Options = new FaceSubdivideToHexagonWiresDto();\n hexSubdivision1Options.shape = mainFace;\n hexSubdivision1Options.nrHexagonsU = nrHexagonsU;\n hexSubdivision1Options.nrHexagonsV = nrHexagonsV;\n const hexWires1 = await face.subdivideToHexagonWires(hexSubdivision1Options);\n\n // Create second hexagon subdivision (scaled pattern)\n const hexSubdivision2Options = new FaceSubdivideToHexagonWiresDto();\n hexSubdivision2Options.shape = mainFace;\n hexSubdivision2Options.nrHexagonsU = nrHexagonsU;\n hexSubdivision2Options.nrHexagonsV = nrHexagonsV;\n hexSubdivision2Options.scalePatternU = scalePattern;\n hexSubdivision2Options.scalePatternV = scalePattern;\n const hexWires2 = await face.subdivideToHexagonWires(hexSubdivision2Options);\n\n // Reverse the wires from the second subdivision using for loop\n const reversedWiresPromises: Promise[] = [];\n for (const hexWire of hexWires2) {\n const reversedWire = wire.reversedWire({ shape: hexWire });\n reversedWiresPromises.push(reversedWire);\n }\n\n const reversedWires = await Promise.all(reversedWiresPromises);\n\n // Combine both wire sets - equivalent to flip lists operation in Rete\n const frameWiresGrouped = hexWires1.map((h, i) => [h, reversedWires[i]]);\n\n // Create frames\n const framePromises = frameWiresGrouped.map(f => {\n const faceFromWires2Options = new FaceFromWiresDto();\n faceFromWires2Options.shapes = f;\n faceFromWires2Options.planar = false;\n return face.createFaceFromWires(faceFromWires2Options);\n });\n\n const frames = await Promise.all(framePromises);\n\n const firstFrames = await bitbybit.lists.getByPattern({\n list: frames,\n pattern: [true, true, false]\n });\n\n const secondFrames = await bitbybit.lists.getByPattern({\n list: frames,\n pattern: [false, false, true]\n })\n\n // Create first compound from the first pattern of hexagon faces\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = firstFrames;\n const firstCompound = await compound.makeCompound(compoundOptions);\n\n // Create second compound from the first pattern of hexagon faces\n compoundOptions.shapes = secondFrames;\n const secondCompound = await compound.makeCompound(compoundOptions);\n\n // Create materials for rendering\n const firstMaterial = new PBRMetallicRoughnessDto();\n firstMaterial.name = \"Blue Material\";\n firstMaterial.baseColor = \"#9155ff\";\n firstMaterial.metallic = 0.1;\n firstMaterial.roughness = 0.9;\n firstMaterial.backFaceCulling = false;\n firstMaterial.zOffset = 3;\n const blueMatResult = material.pbrMetallicRoughness.create(firstMaterial);\n\n // Create drawing options for the first frames\n const firstDrawOptions = new DrawOcctShapeOptions();\n firstDrawOptions.drawEdges = true;\n firstDrawOptions.edgeColour = \"#000000\";\n firstDrawOptions.edgeWidth = 10;\n firstDrawOptions.faceMaterial = blueMatResult;\n\n bitbybit.draw.drawAnyAsync({\n entity: firstCompound,\n options: firstDrawOptions\n });\n\n // Create materials for rendering\n const secondMaterial = new PBRMetallicRoughnessDto();\n secondMaterial.name = \"Black Material\";\n secondMaterial.baseColor = \"#000000\";\n secondMaterial.metallic = 0.9;\n secondMaterial.roughness = 0.23;\n secondMaterial.backFaceCulling = false;\n secondMaterial.zOffset = 3;\n const secondMatResult = material.pbrMetallicRoughness.create(secondMaterial);\n\n // Create drawing options for the first frames\n const secondDrawOptions = new DrawOcctShapeOptions();\n secondDrawOptions.drawEdges = true;\n secondDrawOptions.edgeColour = \"#000000\";\n secondDrawOptions.edgeWidth = 10;\n secondDrawOptions.faceMaterial = secondMatResult;\n\n bitbybit.draw.drawAnyAsync({\n entity: secondCompound,\n options: secondDrawOptions\n });\n\n // Set up scene lighting and camera\n const skyboxOptions = new SkyboxDto();\n skyboxOptions.skybox = skyboxEnum.city;\n skyboxOptions.hideSkybox = true;\n scene.enableSkybox(skyboxOptions);\n\n const dirLightOptions = new DirectionalLightDto();\n dirLightOptions.intensity = 3;\n scene.drawDirectionalLight(dirLightOptions);\n\n const gradientBackgroundOptions = new SceneTwoColorLinearGradientDto();\n gradientBackgroundOptions.colorFrom = \"#050506\";\n gradientBackgroundOptions.colorTo = \"#627a9d\";\n gradientBackgroundOptions.direction = gradientDirectionEnum.toTop;\n scene.twoColorLinearGradient(gradientBackgroundOptions);\n\n const cameraConfigurationOptions = new CameraConfigurationDto();\n cameraConfigurationOptions.position = [44, 30, 44];\n cameraConfigurationOptions.lookAt = [0, 15, 0];\n scene.adjustActiveArcRotateCamera(cameraConfigurationOptions);\n\n const gridOptions = new SceneDrawGridMeshDto();\n bitbybit.draw.drawGridMesh(gridOptions);\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs for wire creation, lofting, face operations, and compounds\nconst { InterpolationDto, LoftDto, ShapeIndexDto, FaceSubdivideToHexagonWiresDto, FaceFromWiresDto, CompoundShapesDto } = Bit.Inputs.OCCT;\nconst { DrawOcctShapeOptions, SceneDrawGridMeshDto } = Bit.Inputs.Draw;\nconst { PBRMetallicRoughnessDto } = Bit.Inputs.BabylonMaterial;\nconst { CameraConfigurationDto, DirectionalLightDto, SceneTwoColorLinearGradientDto, SkyboxDto } = Bit.Inputs.BabylonScene;\nconst { skyboxEnum, gradientDirectionEnum } = Bit.Inputs.Base;\n\n\n// Import type definitions for type safety\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSCompoundPointer = Bit.Inputs.OCCT.TopoDSCompoundPointer;\n// Get access to OCCT modules\nconst { wire, face, compound } = bitbybit.occt.shapes;\nconst { operations } = bitbybit.occt;\nconst { material } = bitbybit.babylon;\nconst { scene } = bitbybit.babylon;\n\n// Define the main function to create complex face compound\nconst start = async () => {\n // Define point sets for three different wire levels\n const bottomPoints: Point3[] = [\n [-30, 0, -20],\n [-10, 0, 0],\n [0, 0, 10],\n [10, 0, 0],\n [30, 0, -20]\n ];\n\n const middlePoints: Point3[] = [\n [-20, 20, -10],\n [-5, 20, 15],\n [0, 20, 20],\n [5, 20, 15],\n [20, 20, -10]\n ];\n\n const topPoints: Point3[] = [\n [-15, 30, 0],\n [-5, 30, 5],\n [0, 30, 10],\n [5, 30, 5],\n [15, 30, 0]\n ];\n\n // Create wires by interpolating points\n const bottomWireOptions = new InterpolationDto();\n bottomWireOptions.points = bottomPoints;\n bottomWireOptions.periodic = false;\n bottomWireOptions.tolerance = 0.1;\n const bottomWire = await wire.interpolatePoints(bottomWireOptions);\n\n const middleWireOptions = new InterpolationDto();\n middleWireOptions.points = middlePoints;\n middleWireOptions.periodic = false;\n middleWireOptions.tolerance = 0.1;\n const middleWire = await wire.interpolatePoints(middleWireOptions);\n\n const topWireOptions = new InterpolationDto();\n topWireOptions.points = topPoints;\n topWireOptions.periodic = false;\n topWireOptions.tolerance = 0.1;\n const topWire = await wire.interpolatePoints(topWireOptions);\n\n // Create list of wires for lofting\n const wiresList = [bottomWire, middleWire, topWire];\n\n // Loft the wires to create a surface\n const loftOptions = new LoftDto();\n loftOptions.shapes = wiresList;\n loftOptions.makeSolid = false;\n const loftedSurface = await operations.loft(loftOptions);\n\n // Get the face from the lofted surface\n const getFaceOptions = new ShapeIndexDto();\n getFaceOptions.shape = loftedSurface;\n getFaceOptions.index = 0;\n const mainFace = await face.getFace(getFaceOptions);\n\n // Subdivision parameters\n const nrHexagonsU = 28;\n const nrHexagonsV = 10;\n const scalePattern = [0.7];\n\n // Create first hexagon subdivision (regular pattern)\n const hexSubdivision1Options = new FaceSubdivideToHexagonWiresDto();\n hexSubdivision1Options.shape = mainFace;\n hexSubdivision1Options.nrHexagonsU = nrHexagonsU;\n hexSubdivision1Options.nrHexagonsV = nrHexagonsV;\n const hexWires1 = await face.subdivideToHexagonWires(hexSubdivision1Options);\n\n // Create second hexagon subdivision (scaled pattern)\n const hexSubdivision2Options = new FaceSubdivideToHexagonWiresDto();\n hexSubdivision2Options.shape = mainFace;\n hexSubdivision2Options.nrHexagonsU = nrHexagonsU;\n hexSubdivision2Options.nrHexagonsV = nrHexagonsV;\n hexSubdivision2Options.scalePatternU = scalePattern;\n hexSubdivision2Options.scalePatternV = scalePattern;\n const hexWires2 = await face.subdivideToHexagonWires(hexSubdivision2Options);\n\n // Reverse the wires from the second subdivision using for loop\n const reversedWiresPromises: Promise[] = [];\n for (const hexWire of hexWires2) {\n const reversedWire = wire.reversedWire({ shape: hexWire });\n reversedWiresPromises.push(reversedWire);\n }\n\n const reversedWires = await Promise.all(reversedWiresPromises);\n\n // Combine both wire sets - equivalent to flip lists operation in Rete\n const frameWiresGrouped = hexWires1.map((h, i) => [h, reversedWires[i]]);\n\n // Create frames\n const framePromises = frameWiresGrouped.map(f => {\n const faceFromWires2Options = new FaceFromWiresDto();\n faceFromWires2Options.shapes = f;\n faceFromWires2Options.planar = false;\n return face.createFaceFromWires(faceFromWires2Options);\n });\n\n const frames = await Promise.all(framePromises);\n\n const firstFrames = await bitbybit.lists.getByPattern({\n list: frames,\n pattern: [true, true, false]\n });\n\n const secondFrames = await bitbybit.lists.getByPattern({\n list: frames,\n pattern: [false, false, true]\n })\n\n // Create first compound from the first pattern of hexagon faces\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = firstFrames;\n const firstCompound = await compound.makeCompound(compoundOptions);\n\n // Create second compound from the first pattern of hexagon faces\n compoundOptions.shapes = secondFrames;\n const secondCompound = await compound.makeCompound(compoundOptions);\n\n // Create materials for rendering\n const firstMaterial = new PBRMetallicRoughnessDto();\n firstMaterial.name = \"Blue Material\";\n firstMaterial.baseColor = \"#9155ff\";\n firstMaterial.metallic = 0.1;\n firstMaterial.roughness = 0.9;\n firstMaterial.backFaceCulling = false;\n firstMaterial.zOffset = 3;\n const blueMatResult = material.pbrMetallicRoughness.create(firstMaterial);\n\n // Create drawing options for the first frames\n const firstDrawOptions = new DrawOcctShapeOptions();\n firstDrawOptions.drawEdges = true;\n firstDrawOptions.edgeColour = \"#000000\";\n firstDrawOptions.edgeWidth = 10;\n firstDrawOptions.faceMaterial = blueMatResult;\n\n bitbybit.draw.drawAnyAsync({\n entity: firstCompound,\n options: firstDrawOptions\n });\n\n // Create materials for rendering\n const secondMaterial = new PBRMetallicRoughnessDto();\n secondMaterial.name = \"Black Material\";\n secondMaterial.baseColor = \"#000000\";\n secondMaterial.metallic = 0.9;\n secondMaterial.roughness = 0.23;\n secondMaterial.backFaceCulling = false;\n secondMaterial.zOffset = 3;\n const secondMatResult = material.pbrMetallicRoughness.create(secondMaterial);\n\n // Create drawing options for the first frames\n const secondDrawOptions = new DrawOcctShapeOptions();\n secondDrawOptions.drawEdges = true;\n secondDrawOptions.edgeColour = \"#000000\";\n secondDrawOptions.edgeWidth = 10;\n secondDrawOptions.faceMaterial = secondMatResult;\n\n bitbybit.draw.drawAnyAsync({\n entity: secondCompound,\n options: secondDrawOptions\n });\n\n // Set up scene lighting and camera\n const skyboxOptions = new SkyboxDto();\n skyboxOptions.skybox = skyboxEnum.city;\n skyboxOptions.hideSkybox = true;\n scene.enableSkybox(skyboxOptions);\n\n const dirLightOptions = new DirectionalLightDto();\n dirLightOptions.intensity = 3;\n scene.drawDirectionalLight(dirLightOptions);\n\n const gradientBackgroundOptions = new SceneTwoColorLinearGradientDto();\n gradientBackgroundOptions.colorFrom = \"#050506\";\n gradientBackgroundOptions.colorTo = \"#627a9d\";\n gradientBackgroundOptions.direction = gradientDirectionEnum.toTop;\n scene.twoColorLinearGradient(gradientBackgroundOptions);\n\n const cameraConfigurationOptions = new CameraConfigurationDto();\n cameraConfigurationOptions.position = [44, 30, 44];\n cameraConfigurationOptions.lookAt = [0, 15, 0];\n scene.adjustActiveArcRotateCamera(cameraConfigurationOptions);\n\n const gridOptions = new SceneDrawGridMeshDto();\n bitbybit.draw.drawGridMesh(gridOptions);\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Compounding hex frames into single entity will render faster" /> diff --git a/docs/learn/code/common/occt/shapes/compound/intro.md b/docs/learn/code/common/occt/shapes/compound/intro.md index 0bf3384f..30d4f7c1 100644 --- a/docs/learn/code/common/occt/shapes/compound/intro.md +++ b/docs/learn/code/common/occt/shapes/compound/intro.md @@ -48,21 +48,21 @@ If you're not experiencing noticeable performance issues in the first example, t gridSizesphereRadiusspacinghalfGridxPositionsyPositionszPositionsxyzgridSize3sphereRadius1spacing2.5halfGridDIVIDEMULTIPLYgridSizespacing2xPositionsspacingNEGhalfGridhalfGridyPositionsspacingNEGhalfGridhalfGridzPositionsspacingNEGhalfGridhalfGridx1xPositions1y1yPositions1z1zPositions1GETFROM_STARTxPositionsxGETFROM_STARTyPositionsyGETFROM_STARTzPositionsz","version":"0.20.14","type":"blockly"}} + script={{"script":"gridSizesphereRadiusspacinghalfGridxPositionsyPositionszPositionsxyzgridSize3sphereRadius1spacing2.5halfGridDIVIDEMULTIPLYgridSizespacing2xPositionsspacingNEGhalfGridhalfGridyPositionsspacingNEGhalfGridhalfGridzPositionsspacingNEGhalfGridhalfGridx1xPositions1y1yPositions1z1zPositions1GETFROM_STARTxPositionsxGETFROM_STARTyPositionsyGETFROM_STARTzPositionsz","version":"0.21.0","type":"blockly"}} title="Creating individual spheres leads to performance issues" /> {\n // Grid parameters\n const gridSize = 3; // Number of spheres per side\n const sphereRadius = 1; // Radius of each sphere\n const spacing = 2.5; // Distance between sphere centers\n \n // Calculate grid boundaries\n const halfGrid = (gridSize * spacing) / 2;\n \n // Generate grid positions using span functions for 3D grid\n const xPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n \n const yPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n \n const zPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n \n // Create individual spheres using nested loops for 3D grid\n // This approach creates each sphere separately, leading to performance issues\n for (const xPos of xPositions) {\n for (const yPos of yPositions) {\n for (const zPos of zPositions) {\n // Define sphere creation options\n const sphereOptions = new SphereDto();\n sphereOptions.radius = sphereRadius;\n sphereOptions.center = [xPos, yPos, zPos];\n \n // Create and immediately draw each sphere individually\n // This is inefficient as each sphere requires its own mesh and draw call\n const sphere = await solid.createSphere(sphereOptions);\n \n // Each draw call is separate, creating performance overhead\n bitbybit.draw.drawAnyAsync({\n entity: sphere\n });\n }\n }\n }\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs for creating spheres\nconst { SphereDto } = Bit.Inputs.OCCT;\n// Import type definitions for type safety\ntype Point3 = Bit.Inputs.Base.Point3;\n\n// Get access to OCCT modules and utility functions\nconst { solid } = bitbybit.occt.shapes;\nconst { vector } = bitbybit;\n\n// Define the main function to create individual spheres (performance problem)\nconst start = async () => {\n // Grid parameters\n const gridSize = 3; // Number of spheres per side\n const sphereRadius = 1; // Radius of each sphere\n const spacing = 2.5; // Distance between sphere centers\n \n // Calculate grid boundaries\n const halfGrid = (gridSize * spacing) / 2;\n \n // Generate grid positions using span functions for 3D grid\n const xPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n \n const yPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n \n const zPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n \n // Create individual spheres using nested loops for 3D grid\n // This approach creates each sphere separately, leading to performance issues\n for (const xPos of xPositions) {\n for (const yPos of yPositions) {\n for (const zPos of zPositions) {\n // Define sphere creation options\n const sphereOptions = new SphereDto();\n sphereOptions.radius = sphereRadius;\n sphereOptions.center = [xPos, yPos, zPos];\n \n // Create and immediately draw each sphere individually\n // This is inefficient as each sphere requires its own mesh and draw call\n const sphere = await solid.createSphere(sphereOptions);\n \n // Each draw call is separate, creating performance overhead\n bitbybit.draw.drawAnyAsync({\n entity: sphere\n });\n }\n }\n }\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Creating individual spheres leads to performance issues" /> @@ -76,21 +76,21 @@ The solution to this performance problem is to use compounds. Instead of creatin gridSizesphereRadiusspacinghalfGridxPositionsyPositionszPositionsspheresxycompoundzgridSize3sphereRadius1spacing2.5halfGridDIVIDEMULTIPLYgridSizespacing2xPositionsspacingNEGhalfGridhalfGridyPositionsspacingNEGhalfGridhalfGridzPositionsspacingNEGhalfGridhalfGridspheresx1xPositions1y1yPositions1z1zPositions1INSERTLASTspheressphereRadiusGETFROM_STARTxPositionsxGETFROM_STARTyPositionsyGETFROM_STARTzPositionszcompoundspherescompound","version":"0.20.14","type":"blockly"}} + script={{"script":"gridSizesphereRadiusspacinghalfGridxPositionsyPositionszPositionsspheresxycompoundzgridSize3sphereRadius1spacing2.5halfGridDIVIDEMULTIPLYgridSizespacing2xPositionsspacingNEGhalfGridhalfGridyPositionsspacingNEGhalfGridhalfGridzPositionsspacingNEGhalfGridhalfGridspheresx1xPositions1y1yPositions1z1zPositions1INSERTLASTspheressphereRadiusGETFROM_STARTxPositionsxGETFROM_STARTyPositionsyGETFROM_STARTzPositionszcompoundspherescompound","version":"0.21.0","type":"blockly"}} title="Compounded spheres provide significantly better performance" /> {\n // Grid parameters\n const gridSize = 5; // Number of spheres per side\n const sphereRadius = 1; // Radius of each sphere\n const spacing = 2.5; // Distance between sphere centers\n\n // Calculate grid boundaries\n const halfGrid = (gridSize * spacing) / 2;\n\n // Generate grid positions using span functions\n const xPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n const yPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n const zPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n // Create array to store all spheres before compounding\n const spheres: TopoDSSolidPointer[] = [];\n\n // Create all spheres first and store them in the array\n for (const xPos of xPositions) {\n for (const yPos of yPositions) {\n for (const zPos of zPositions) {\n // Define sphere creation options\n const sphereOptions = new SphereDto();\n sphereOptions.radius = sphereRadius;\n sphereOptions.center = [xPos, yPos, zPos];\n\n // Create sphere and add to array\n const sphere = await solid.createSphere(sphereOptions);\n spheres.push(sphere);\n }\n }\n }\n\n // Create compound from all spheres\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = spheres;\n const sphereCompound = await compound.makeCompound(compoundOptions);\n\n // Draw compound\n bitbybit.draw.drawAnyAsync({\n entity: sphereCompound\n });\n\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs for creating spheres, compounds, and transformations\nconst { SphereDto, CompoundShapesDto, RotateDto, TranslateDto } = Bit.Inputs.OCCT;\n// Import type definitions for type safety\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSSolidPointer = Bit.Inputs.OCCT.TopoDSSolidPointer;\ntype TopoDSCompoundPointer = Bit.Inputs.OCCT.TopoDSCompoundPointer;\n\n// Get access to OCCT modules and utility functions\nconst { solid, compound } = bitbybit.occt.shapes;\nconst { transforms } = bitbybit.occt;\nconst { vector } = bitbybit;\n\n// Define the main function to create a compound\nconst start = async () => {\n // Grid parameters\n const gridSize = 5; // Number of spheres per side\n const sphereRadius = 1; // Radius of each sphere\n const spacing = 2.5; // Distance between sphere centers\n\n // Calculate grid boundaries\n const halfGrid = (gridSize * spacing) / 2;\n\n // Generate grid positions using span functions\n const xPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n const yPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n const zPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n // Create array to store all spheres before compounding\n const spheres: TopoDSSolidPointer[] = [];\n\n // Create all spheres first and store them in the array\n for (const xPos of xPositions) {\n for (const yPos of yPositions) {\n for (const zPos of zPositions) {\n // Define sphere creation options\n const sphereOptions = new SphereDto();\n sphereOptions.radius = sphereRadius;\n sphereOptions.center = [xPos, yPos, zPos];\n\n // Create sphere and add to array\n const sphere = await solid.createSphere(sphereOptions);\n spheres.push(sphere);\n }\n }\n }\n\n // Create compound from all spheres\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = spheres;\n const sphereCompound = await compound.makeCompound(compoundOptions);\n\n // Draw compound\n bitbybit.draw.drawAnyAsync({\n entity: sphereCompound\n });\n\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Compounded spheres provide significantly better performance" /> @@ -105,21 +105,21 @@ Another major advantage of compounds is the ability to transform the entire grou gridSizesphereRadiusspacinghalfGridxPositionsyPositionszPositionsspheresxycompoundzrotatedCompoundgridSize5sphereRadius1spacing2.5halfGridDIVIDEMULTIPLYgridSizespacing2xPositionsspacingNEGhalfGridhalfGridyPositionsspacingNEGhalfGridhalfGridzPositionsspacingNEGhalfGridhalfGridspheresx1xPositions1y1yPositions1z1zPositions1INSERTLASTspheressphereRadiusGETFROM_STARTxPositionsxGETFROM_STARTyPositionsyGETFROM_STARTzPositionszcompoundspheresrotatedCompoundcompound00145rotatedCompound","version":"0.20.14","type":"blockly"}} + script={{"script":"gridSizesphereRadiusspacinghalfGridxPositionsyPositionszPositionsspheresxycompoundzrotatedCompoundgridSize5sphereRadius1spacing2.5halfGridDIVIDEMULTIPLYgridSizespacing2xPositionsspacingNEGhalfGridhalfGridyPositionsspacingNEGhalfGridhalfGridzPositionsspacingNEGhalfGridhalfGridspheresx1xPositions1y1yPositions1z1zPositions1INSERTLASTspheressphereRadiusGETFROM_STARTxPositionsxGETFROM_STARTyPositionsyGETFROM_STARTzPositionszcompoundspheresrotatedCompoundcompound00145rotatedCompound","version":"0.21.0","type":"blockly"}} title="Compound can be rotated and translated as a single grouped entity" /> {\n // Grid parameters\n const gridSize = 5; // Number of spheres per side\n const sphereRadius = 1; // Radius of each sphere\n const spacing = 2.5; // Distance between sphere centers\n\n // Calculate grid boundaries\n const halfGrid = (gridSize * spacing) / 2;\n\n // Generate grid positions using span functions\n const xPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n const yPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n const zPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n // Create array to store all spheres before compounding\n const spheres: TopoDSSolidPointer[] = [];\n\n // Create all spheres first and store them in the array\n for (const xPos of xPositions) {\n for (const yPos of yPositions) {\n for (const zPos of zPositions) {\n // Define sphere creation options\n const sphereOptions = new SphereDto();\n sphereOptions.radius = sphereRadius;\n sphereOptions.center = [xPos, yPos, zPos];\n\n // Create sphere and add to array\n const sphere = await solid.createSphere(sphereOptions);\n spheres.push(sphere);\n }\n }\n }\n\n // Create compound from all spheres\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = spheres;\n const sphereCompound = await compound.makeCompound(compoundOptions);\n\n // Transform the entire compound as a single entity\n // First, rotate the compound around the Z-axis\n const rotateOptions = new RotateDto();\n rotateOptions.shape = sphereCompound;\n rotateOptions.axis = [0, 0, 1]; // Z-axis rotation\n rotateOptions.angle = 45; // 45 degrees\n const rotatedCompound = await transforms.rotate(rotateOptions);\n\n // Draw the transformed compound\n // All spheres move together as a single unified entity\n bitbybit.draw.drawAnyAsync({\n entity: rotatedCompound\n });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs for creating spheres, compounds, and transformations\nconst { SphereDto, CompoundShapesDto, RotateDto, TranslateDto } = Bit.Inputs.OCCT;\n// Import type definitions for type safety\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSSolidPointer = Bit.Inputs.OCCT.TopoDSSolidPointer;\ntype TopoDSCompoundPointer = Bit.Inputs.OCCT.TopoDSCompoundPointer;\n\n// Get access to OCCT modules and utility functions\nconst { solid, compound } = bitbybit.occt.shapes;\nconst { transforms } = bitbybit.occt;\nconst { vector } = bitbybit;\n\n// Define the main function to create and transform a compound (unified transformation)\nconst start = async () => {\n // Grid parameters\n const gridSize = 5; // Number of spheres per side\n const sphereRadius = 1; // Radius of each sphere\n const spacing = 2.5; // Distance between sphere centers\n\n // Calculate grid boundaries\n const halfGrid = (gridSize * spacing) / 2;\n\n // Generate grid positions using span functions\n const xPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n const yPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n const zPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n // Create array to store all spheres before compounding\n const spheres: TopoDSSolidPointer[] = [];\n\n // Create all spheres first and store them in the array\n for (const xPos of xPositions) {\n for (const yPos of yPositions) {\n for (const zPos of zPositions) {\n // Define sphere creation options\n const sphereOptions = new SphereDto();\n sphereOptions.radius = sphereRadius;\n sphereOptions.center = [xPos, yPos, zPos];\n\n // Create sphere and add to array\n const sphere = await solid.createSphere(sphereOptions);\n spheres.push(sphere);\n }\n }\n }\n\n // Create compound from all spheres\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = spheres;\n const sphereCompound = await compound.makeCompound(compoundOptions);\n\n // Transform the entire compound as a single entity\n // First, rotate the compound around the Z-axis\n const rotateOptions = new RotateDto();\n rotateOptions.shape = sphereCompound;\n rotateOptions.axis = [0, 0, 1]; // Z-axis rotation\n rotateOptions.angle = 45; // 45 degrees\n const rotatedCompound = await transforms.rotate(rotateOptions);\n\n // Draw the transformed compound\n // All spheres move together as a single unified entity\n bitbybit.draw.drawAnyAsync({\n entity: rotatedCompound\n });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Compound can be rotated and translated as a single grouped entity" /> diff --git a/docs/learn/code/common/occt/shapes/edge/edge-constraints.md b/docs/learn/code/common/occt/shapes/edge/edge-constraints.md index 1a47f2a3..b7a1912b 100644 --- a/docs/learn/code/common/occt/shapes/edge/edge-constraints.md +++ b/docs/learn/code/common/occt/shapes/edge/edge-constraints.md @@ -46,21 +46,21 @@ This is particularly useful in mechanical design when you need to connect two sp circlepoint1point2tangentLinescircle4000010point1007point2909tangentLinescirclepoint1point21e-7'all''none'tangentLinescirclepoint1point2","version":"0.20.14","type":"blockly"}} + script={{"script":"circlepoint1point2tangentLinescircle4000010point1007point2909tangentLinescirclepoint1point21e-7'all''none'tangentLinescirclepoint1point2","version":"0.21.0","type":"blockly"}} title="Constraint tangent lines from two points to circle" /> {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 4;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Define two points\n const point1: Point3 = [0, 0, 7];\n const point2: Point3 = [9, 0, 9];\n\n // Create constraint options for tangent lines from two points to circle\n const constraintOptions = new ConstraintTanLinesFromTwoPtsToCircleDto();\n constraintOptions.circle = circle;\n constraintOptions.point1 = point1;\n constraintOptions.point2 = point2;\n constraintOptions.tolerance = 1e-7;\n constraintOptions.positionResult = positionResultEnum.all;\n constraintOptions.circleRemainder = circleInclusionEnum.none;\n\n // Create the constraint tangent lines\n const tangentLines = await bitbybit.occt.shapes.edge.constraintTanLinesFromTwoPtsToCircle(constraintOptions);\n\n // Draw the tangent lines\n bitbybit.draw.drawAnyAsync({ entity: tangentLines });\n // Draw the circle\n bitbybit.draw.drawAnyAsync({ entity: circle });\n // Draw the two points\n bitbybit.draw.drawAnyAsync({ entity: [point1] });\n bitbybit.draw.drawAnyAsync({ entity: [point2] });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const { CircleDto, ConstraintTanLinesFromTwoPtsToCircleDto, positionResultEnum, circleInclusionEnum } = Bit.Inputs.OCCT;\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;\n\n// Define the main function\nconst start = async () => {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 4;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Define two points\n const point1: Point3 = [0, 0, 7];\n const point2: Point3 = [9, 0, 9];\n\n // Create constraint options for tangent lines from two points to circle\n const constraintOptions = new ConstraintTanLinesFromTwoPtsToCircleDto();\n constraintOptions.circle = circle;\n constraintOptions.point1 = point1;\n constraintOptions.point2 = point2;\n constraintOptions.tolerance = 1e-7;\n constraintOptions.positionResult = positionResultEnum.all;\n constraintOptions.circleRemainder = circleInclusionEnum.none;\n\n // Create the constraint tangent lines\n const tangentLines = await bitbybit.occt.shapes.edge.constraintTanLinesFromTwoPtsToCircle(constraintOptions);\n\n // Draw the tangent lines\n bitbybit.draw.drawAnyAsync({ entity: tangentLines });\n // Draw the circle\n bitbybit.draw.drawAnyAsync({ entity: circle });\n // Draw the two points\n bitbybit.draw.drawAnyAsync({ entity: [point1] });\n bitbybit.draw.drawAnyAsync({ entity: [point2] });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Constraint tangent lines from two points to circle" /> @@ -77,21 +77,21 @@ This operation is commonly used in architectural drawings when you need to creat circlepointtangentLinescircle4000010point807tangentLinescirclepoint1e-7'all''none'tangentLinescirclepoint","version":"0.20.14","type":"blockly"}} + script={{"script":"circlepointtangentLinescircle4000010point807tangentLinescirclepoint1e-7'all''none'tangentLinescirclepoint","version":"0.21.0","type":"blockly"}} title="Constraint tangent lines from point to circle" /> {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 4;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Define a point\n const point: Point3 = [8, 0, 7];\n\n // Create constraint options for tangent lines from point to circle\n const constraintOptions = new ConstraintTanLinesFromPtToCircleDto();\n constraintOptions.circle = circle;\n constraintOptions.point = point;\n constraintOptions.tolerance = 1e-7;\n constraintOptions.positionResult = positionResultEnum.all;\n constraintOptions.circleRemainder = circleInclusionEnum.none;\n\n // Create the constraint tangent lines\n const tangentLines = await bitbybit.occt.shapes.edge.constraintTanLinesFromPtToCircle(constraintOptions);\n\n // Draw the tangent lines\n bitbybit.draw.drawAnyAsync({ entity: tangentLines });\n // Draw the circle\n bitbybit.draw.drawAnyAsync({ entity: circle });\n // Draw the point\n bitbybit.draw.drawAnyAsync({ entity: point });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const { CircleDto, ConstraintTanLinesFromPtToCircleDto, positionResultEnum, circleInclusionEnum } = Bit.Inputs.OCCT;\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;\n\n// Define the main function\nconst start = async () => {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 4;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Define a point\n const point: Point3 = [8, 0, 7];\n\n // Create constraint options for tangent lines from point to circle\n const constraintOptions = new ConstraintTanLinesFromPtToCircleDto();\n constraintOptions.circle = circle;\n constraintOptions.point = point;\n constraintOptions.tolerance = 1e-7;\n constraintOptions.positionResult = positionResultEnum.all;\n constraintOptions.circleRemainder = circleInclusionEnum.none;\n\n // Create the constraint tangent lines\n const tangentLines = await bitbybit.occt.shapes.edge.constraintTanLinesFromPtToCircle(constraintOptions);\n\n // Draw the tangent lines\n bitbybit.draw.drawAnyAsync({ entity: tangentLines });\n // Draw the circle\n bitbybit.draw.drawAnyAsync({ entity: circle });\n // Draw the point\n bitbybit.draw.drawAnyAsync({ entity: point });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Constraint tangent lines from point to circle" /> @@ -107,21 +107,21 @@ This is especially valuable in gear design, pulley systems, or any mechanical ap circle1circle2tangentLinescircle13000010circle22700010tangentLinescircle1circle21e-7'all''none'tangentLinescircle1circle2","version":"0.20.14","type":"blockly"}} + script={{"script":"circle1circle2tangentLinescircle13000010circle22700010tangentLinescircle1circle21e-7'all''none'tangentLinescircle1circle2","version":"0.21.0","type":"blockly"}} title="Constraint tangent lines on two circles" /> {\n // Create first circle edge\n const circle1Options = new CircleDto();\n circle1Options.radius = 3;\n circle1Options.center = [0, 0, 0] as Point3;\n circle1Options.direction = [0, 1, 0] as Vector3;\n\n const circle1 = await bitbybit.occt.shapes.edge.createCircleEdge(circle1Options);\n\n // Create second circle edge\n const circle2Options = new CircleDto();\n circle2Options.radius = 2;\n circle2Options.center = [7, 0, 0] as Point3;\n circle2Options.direction = [0, 1, 0] as Vector3;\n\n const circle2 = await bitbybit.occt.shapes.edge.createCircleEdge(circle2Options);\n\n // Create constraint options for tangent lines between two circles\n const constraintOptions = new ConstraintTanLinesOnTwoCirclesDto();\n constraintOptions.circle1 = circle1;\n constraintOptions.circle2 = circle2;\n constraintOptions.tolerance = 1e-7;\n constraintOptions.positionResult = positionResultEnum.all;\n constraintOptions.circleRemainders = twoCircleInclusionEnum.none;\n\n // Create the constraint tangent lines\n const tangentLines = await bitbybit.occt.shapes.edge.constraintTanLinesOnTwoCircles(constraintOptions);\n\n // Draw the tangent lines\n bitbybit.draw.drawAnyAsync({ entity: tangentLines });\n // Draw the first circle\n bitbybit.draw.drawAnyAsync({ entity: circle1 });\n // Draw the second circle\n bitbybit.draw.drawAnyAsync({ entity: circle2 });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const { CircleDto, ConstraintTanLinesOnTwoCirclesDto, positionResultEnum, twoCircleInclusionEnum } = Bit.Inputs.OCCT;\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;\n\n// Define the main function\nconst start = async () => {\n // Create first circle edge\n const circle1Options = new CircleDto();\n circle1Options.radius = 3;\n circle1Options.center = [0, 0, 0] as Point3;\n circle1Options.direction = [0, 1, 0] as Vector3;\n\n const circle1 = await bitbybit.occt.shapes.edge.createCircleEdge(circle1Options);\n\n // Create second circle edge\n const circle2Options = new CircleDto();\n circle2Options.radius = 2;\n circle2Options.center = [7, 0, 0] as Point3;\n circle2Options.direction = [0, 1, 0] as Vector3;\n\n const circle2 = await bitbybit.occt.shapes.edge.createCircleEdge(circle2Options);\n\n // Create constraint options for tangent lines between two circles\n const constraintOptions = new ConstraintTanLinesOnTwoCirclesDto();\n constraintOptions.circle1 = circle1;\n constraintOptions.circle2 = circle2;\n constraintOptions.tolerance = 1e-7;\n constraintOptions.positionResult = positionResultEnum.all;\n constraintOptions.circleRemainders = twoCircleInclusionEnum.none;\n\n // Create the constraint tangent lines\n const tangentLines = await bitbybit.occt.shapes.edge.constraintTanLinesOnTwoCircles(constraintOptions);\n\n // Draw the tangent lines\n bitbybit.draw.drawAnyAsync({ entity: tangentLines });\n // Draw the first circle\n bitbybit.draw.drawAnyAsync({ entity: circle1 });\n // Draw the second circle\n bitbybit.draw.drawAnyAsync({ entity: circle2 });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Constraint tangent lines on two circles" /> @@ -138,21 +138,21 @@ This is particularly useful for creating buffer zones around existing circular f circle1circle2tangentCirclescircle13000010circle21.5500010tangentCirclescircle1circle21e-70.8tangentCirclescircle1circle2","version":"0.20.14","type":"blockly"}} + script={{"script":"circle1circle2tangentCirclescircle13000010circle21.5500010tangentCirclescircle1circle21e-70.8tangentCirclescircle1circle2","version":"0.21.0","type":"blockly"}} title="Constraint tangent circles on two circles" /> {\n // Create first circle edge\n const circle1Options = new CircleDto();\n circle1Options.radius = 3;\n circle1Options.center = [0, 0, 0] as Point3;\n circle1Options.direction = [0, 1, 0] as Vector3;\n\n const circle1 = await bitbybit.occt.shapes.edge.createCircleEdge(circle1Options);\n\n // Create second circle edge\n const circle2Options = new CircleDto();\n circle2Options.radius = 1.5;\n circle2Options.center = [5, 0, 0] as Point3;\n circle2Options.direction = [0, 1, 0] as Vector3;\n\n const circle2 = await bitbybit.occt.shapes.edge.createCircleEdge(circle2Options);\n\n // Create constraint options for tangent circles between two circles\n const constraintOptions = new ConstraintTanCirclesOnTwoCirclesDto();\n constraintOptions.circle1 = circle1;\n constraintOptions.circle2 = circle2;\n constraintOptions.tolerance = 1e-7;\n constraintOptions.radius = 0.8;\n\n // Create the constraint tangent circles\n const tangentCircles = await bitbybit.occt.shapes.edge.constraintTanCirclesOnTwoCircles(constraintOptions);\n\n // Draw the tangent circles\n bitbybit.draw.drawAnyAsync({ entity: tangentCircles });\n // Draw the first circle\n bitbybit.draw.drawAnyAsync({ entity: circle1 });\n // Draw the second circle\n bitbybit.draw.drawAnyAsync({ entity: circle2 });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const { CircleDto, ConstraintTanCirclesOnTwoCirclesDto } = Bit.Inputs.OCCT;\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;\n\n// Define the main function\nconst start = async () => {\n // Create first circle edge\n const circle1Options = new CircleDto();\n circle1Options.radius = 3;\n circle1Options.center = [0, 0, 0] as Point3;\n circle1Options.direction = [0, 1, 0] as Vector3;\n\n const circle1 = await bitbybit.occt.shapes.edge.createCircleEdge(circle1Options);\n\n // Create second circle edge\n const circle2Options = new CircleDto();\n circle2Options.radius = 1.5;\n circle2Options.center = [5, 0, 0] as Point3;\n circle2Options.direction = [0, 1, 0] as Vector3;\n\n const circle2 = await bitbybit.occt.shapes.edge.createCircleEdge(circle2Options);\n\n // Create constraint options for tangent circles between two circles\n const constraintOptions = new ConstraintTanCirclesOnTwoCirclesDto();\n constraintOptions.circle1 = circle1;\n constraintOptions.circle2 = circle2;\n constraintOptions.tolerance = 1e-7;\n constraintOptions.radius = 0.8;\n\n // Create the constraint tangent circles\n const tangentCircles = await bitbybit.occt.shapes.edge.constraintTanCirclesOnTwoCircles(constraintOptions);\n\n // Draw the tangent circles\n bitbybit.draw.drawAnyAsync({ entity: tangentCircles });\n // Draw the first circle\n bitbybit.draw.drawAnyAsync({ entity: circle1 });\n // Draw the second circle\n bitbybit.draw.drawAnyAsync({ entity: circle2 });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Constraint tangent circles on two circles" /> @@ -169,21 +169,21 @@ This constraint is perfect for creating rounded transitions in designs where you circlepointtangentCirclescircle3000010point400tangentCirclescirclepoint1e-72tangentCirclescirclepoint","version":"0.20.14","type":"blockly"}} + script={{"script":"circlepointtangentCirclescircle3000010point400tangentCirclescirclepoint1e-72tangentCirclescirclepoint","version":"0.21.0","type":"blockly"}} title="Constraint tangent circles on circle and point" /> {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 3;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Define a point\n const point: Point3 = [4, 0, 0];\n\n // Create constraint options for tangent circles between circle and point\n const constraintOptions = new ConstraintTanCirclesOnCircleAndPntDto();\n constraintOptions.circle = circle;\n constraintOptions.point = point;\n constraintOptions.tolerance = 1e-7;\n constraintOptions.radius = 2;\n\n // Create the constraint tangent circles\n const tangentCircles = await bitbybit.occt.shapes.edge.constraintTanCirclesOnCircleAndPnt(constraintOptions);\n\n // Draw the tangent circles\n bitbybit.draw.drawAnyAsync({ entity: tangentCircles });\n // Draw the circle\n bitbybit.draw.drawAnyAsync({ entity: circle });\n // Draw the point\n bitbybit.draw.drawAnyAsync({ entity: point });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const { CircleDto, ConstraintTanCirclesOnCircleAndPntDto } = Bit.Inputs.OCCT;\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;\n\n// Define the main function\nconst start = async () => {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 3;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Define a point\n const point: Point3 = [4, 0, 0];\n\n // Create constraint options for tangent circles between circle and point\n const constraintOptions = new ConstraintTanCirclesOnCircleAndPntDto();\n constraintOptions.circle = circle;\n constraintOptions.point = point;\n constraintOptions.tolerance = 1e-7;\n constraintOptions.radius = 2;\n\n // Create the constraint tangent circles\n const tangentCircles = await bitbybit.occt.shapes.edge.constraintTanCirclesOnCircleAndPnt(constraintOptions);\n\n // Draw the tangent circles\n bitbybit.draw.drawAnyAsync({ entity: tangentCircles });\n // Draw the circle\n bitbybit.draw.drawAnyAsync({ entity: circle });\n // Draw the point\n bitbybit.draw.drawAnyAsync({ entity: point });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Constraint tangent circles on circle and point" /> diff --git a/docs/learn/code/common/occt/shapes/edge/edge-indexes.mdx b/docs/learn/code/common/occt/shapes/edge/edge-indexes.mdx index 02286289..e16719af 100644 --- a/docs/learn/code/common/occt/shapes/edge/edge-indexes.mdx +++ b/docs/learn/code/common/occt/shapes/edge/edge-indexes.mdx @@ -42,21 +42,21 @@ Below are examples in TypeScript, Blockly, and Rete that demonstrate creating a **TypeScript Example: Drawing Edge Indexes** {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n const drawOpt = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n drawOpt.drawEdgeIndexes = true;\n drawOpt.faceOpacity = 0.3;\n drawOpt.edgeOpacity = 0.3;\n drawOpt.edgeIndexHeight = 0.24\n\n bitbybit.draw.drawAnyAsync({\n entity: box,\n options: drawOpt\n });\n}\n\nstart();\n","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = async () => {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n const drawOpt = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n drawOpt.drawEdgeIndexes = true;\n drawOpt.faceOpacity = 0.3;\n drawOpt.edgeOpacity = 0.3;\n drawOpt.edgeIndexHeight = 0.24\n\n bitbybit.draw.drawAnyAsync({\n entity: box,\n options: drawOpt\n });\n}\n\nstart();\n","version":"0.21.0","type":"typescript"}} title="Edge Indexing" /> **Blockly Example: Drawing Edge Indexes** 58100000.30.3#ffffff#ff00002TRUETRUE0.01TRUE0.24#ff00ffFALSE0.06#0000ff","version":"0.20.14","type":"blockly"}} + script={{"script":"58100000.30.3#ffffff#ff00002TRUETRUE0.01TRUE0.24#ff00ffFALSE0.06#0000ff","version":"0.21.0","type":"blockly"}} title="Edge Indexing" /> **Rete Example: Drawing Edge Indexes** diff --git a/docs/learn/code/common/occt/shapes/edge/edge-primitives.md b/docs/learn/code/common/occt/shapes/edge/edge-primitives.md index 2f79e403..282b011c 100644 --- a/docs/learn/code/common/occt/shapes/edge/edge-primitives.md +++ b/docs/learn/code/common/occt/shapes/edge/edge-primitives.md @@ -48,21 +48,21 @@ Let's start with the most basic edge primitive - the line edge. startPointendPointstartPoint-500endPoint500startPointendPointstartPointendPoint","version":"0.20.14","type":"blockly"}} + script={{"script":"startPointendPointstartPoint-500endPoint500startPointendPointstartPointendPoint","version":"0.21.0","type":"blockly"}} title="Creating primitive solids" /> {\n // Create start and end points\n const startPoint: Point3 = [-5, 0, 0];\n const endPoint: Point3 = [5, 0, 0];\n\n // Create a line between the points\n const lineOptions = new LineDto();\n lineOptions.start = startPoint;\n lineOptions.end = endPoint;\n\n const line = await bitbybit.occt.shapes.edge.line(lineOptions);\n\n // Draw the line and points\n bitbybit.draw.drawAnyAsync({ entity: line });\n bitbybit.draw.drawAnyAsync({ entity: startPoint });\n bitbybit.draw.drawAnyAsync({ entity: endPoint });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const { LineDto } = Bit.Inputs.OCCT;\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\n\n// Define the main function\nconst start = async () => {\n // Create start and end points\n const startPoint: Point3 = [-5, 0, 0];\n const endPoint: Point3 = [5, 0, 0];\n\n // Create a line between the points\n const lineOptions = new LineDto();\n lineOptions.start = startPoint;\n lineOptions.end = endPoint;\n\n const line = await bitbybit.occt.shapes.edge.line(lineOptions);\n\n // Draw the line and points\n bitbybit.draw.drawAnyAsync({ entity: line });\n bitbybit.draw.drawAnyAsync({ entity: startPoint });\n bitbybit.draw.drawAnyAsync({ entity: endPoint });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Creating primitive solids" /> @@ -88,21 +88,21 @@ This example demonstrates how to create a simple straight line edge in 3D space. startPointmidPointendPointstartPoint-500midPoint060endPoint500startPointmidPointendPointstartPointmidPointendPoint","version":"0.20.14","type":"blockly"}} + script={{"script":"startPointmidPointendPointstartPoint-500midPoint060endPoint500startPointmidPointendPointstartPointmidPointendPoint","version":"0.21.0","type":"blockly"}} title="Arc edge through 3 points" /> {\n // Create start and end points\n const startPoint: Point3 = [-5, 0, 0];\n const midPoint: Point3 = [0, 6, 0];\n const endPoint: Point3 = [5, 0, 0];\n\n // Create a arc between three points\n const arcOptions = new ArcEdgeThreePointsDto();\n arcOptions.start = startPoint;\n arcOptions.middle = midPoint;\n arcOptions.end = endPoint;\n\n const arc = await bitbybit.occt.shapes.edge.arcThroughThreePoints(arcOptions);\n\n // Draw the arc and points\n bitbybit.draw.drawAnyAsync({ entity: arc });\n bitbybit.draw.drawAnyAsync({ entity: [startPoint, midPoint, endPoint] });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const { ArcEdgeThreePointsDto } = Bit.Inputs.OCCT;\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\n\n// Define the main function\nconst start = async () => {\n // Create start and end points\n const startPoint: Point3 = [-5, 0, 0];\n const midPoint: Point3 = [0, 6, 0];\n const endPoint: Point3 = [5, 0, 0];\n\n // Create a arc between three points\n const arcOptions = new ArcEdgeThreePointsDto();\n arcOptions.start = startPoint;\n arcOptions.middle = midPoint;\n arcOptions.end = endPoint;\n\n const arc = await bitbybit.occt.shapes.edge.arcThroughThreePoints(arcOptions);\n\n // Draw the arc and points\n bitbybit.draw.drawAnyAsync({ entity: arc });\n bitbybit.draw.drawAnyAsync({ entity: [startPoint, midPoint, endPoint] });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Arc edge through 3 points" /> @@ -128,21 +128,21 @@ This example shows how to create an arc edge that passes through three specific startPointvecEndPtendPointvectorstartPoint-500vecEndPt-230endPoint500vectorstartPointvecEndPtstartPointvectorendPointstartPointvecEndPtendPointstartPointvecEndPt","version":"0.20.14","type":"blockly"}} + script={{"script":"startPointvecEndPtendPointvectorstartPoint-500vecEndPt-230endPoint500vectorstartPointvecEndPtstartPointvectorendPointstartPointvecEndPtendPointstartPointvecEndPt","version":"0.21.0","type":"blockly"}} title="Arc edge from two points and tangent" /> {\n // Create start and end points\n const startPoint: Point3 = [-5, 0, 0];\n const vecEndPt: Point3 = [-2, 3, 0];\n const endPoint: Point3 = [5, 0, 0];\n\n // Create tangent vector\n const vecOpt = new TwoVectorsDto();\n vecOpt.first = startPoint;\n vecOpt.second = vecEndPt;\n const vector = bitbybit.vector.sub(vecOpt) as Vector3;\n\n // Create an arc\n const arcOptions = new ArcEdgeTwoPointsTangentDto();\n arcOptions.start = startPoint;\n arcOptions.tangentVec = vector;\n arcOptions.end = endPoint;\n\n const arc = await bitbybit.occt.shapes.edge.arcThroughTwoPointsAndTangent(arcOptions);\n\n // Draw the arc, points and tangent\n bitbybit.draw.drawAnyAsync({ entity: arc });\n bitbybit.draw.drawAnyAsync({ entity: [startPoint, vecEndPt, endPoint] });\n\n // When two points are provided Bitbybit draws them as a line segment\n bitbybit.draw.drawAnyAsync({ entity: [startPoint, vecEndPt] });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const { ArcEdgeTwoPointsTangentDto } = Bit.Inputs.OCCT;\nconst { TwoVectorsDto } = Bit.Inputs.Vector;\n\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n\n// Define the main function\nconst start = async () => {\n // Create start and end points\n const startPoint: Point3 = [-5, 0, 0];\n const vecEndPt: Point3 = [-2, 3, 0];\n const endPoint: Point3 = [5, 0, 0];\n\n // Create tangent vector\n const vecOpt = new TwoVectorsDto();\n vecOpt.first = startPoint;\n vecOpt.second = vecEndPt;\n const vector = bitbybit.vector.sub(vecOpt) as Vector3;\n\n // Create an arc\n const arcOptions = new ArcEdgeTwoPointsTangentDto();\n arcOptions.start = startPoint;\n arcOptions.tangentVec = vector;\n arcOptions.end = endPoint;\n\n const arc = await bitbybit.occt.shapes.edge.arcThroughTwoPointsAndTangent(arcOptions);\n\n // Draw the arc, points and tangent\n bitbybit.draw.drawAnyAsync({ entity: arc });\n bitbybit.draw.drawAnyAsync({ entity: [startPoint, vecEndPt, endPoint] });\n\n // When two points are provided Bitbybit draws them as a line segment\n bitbybit.draw.drawAnyAsync({ entity: [startPoint, vecEndPt] });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Arc edge from two points and tangent" /> @@ -169,21 +169,21 @@ This example demonstrates creating an arc using two endpoints and a tangent vect circlestartPointendPointcenterPointarccircle5000010startPoint800endPoint808centerPoint000arccirclestartPointendPointTRUEarccenterPointstartPointcenterPointendPointstartPointcenterPointendPoint","version":"0.20.14","type":"blockly"}} + script={{"script":"circlestartPointendPointcenterPointarccircle5000010startPoint800endPoint808centerPoint000arccirclestartPointendPointTRUEarccenterPointstartPointcenterPointendPointstartPointcenterPointendPoint","version":"0.21.0","type":"blockly"}} title="Arc edge from circle and two points" /> {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 5;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Create start and end points for the arc\n const startPoint: Point3 = [8, 0, 0];\n const endPoint: Point3 = [8, 0, 8];\n const centerPoint: Point3 = [0, 0, 0];\n\n // Create arc from circle and two points\n const arcOptions = new ArcEdgeCircleTwoPointsDto();\n arcOptions.circle = circle;\n arcOptions.start = startPoint;\n arcOptions.end = endPoint;\n arcOptions.sense = true;\n\n const arc = await bitbybit.occt.shapes.edge.arcFromCircleAndTwoPoints(arcOptions);\n // Draw the arc and helper points\n bitbybit.draw.drawAnyAsync({ entity: arc });\n bitbybit.draw.drawAnyAsync({ entity: [endPoint, centerPoint, startPoint] });\n bitbybit.draw.drawAnyAsync({ entity: [centerPoint, endPoint] });\n bitbybit.draw.drawAnyAsync({ entity: [centerPoint, startPoint] });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const { CircleDto, ArcEdgeCircleTwoPointsDto } = Bit.Inputs.OCCT;\n// Import required types\ntype TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Define the main function\nconst start = async () => {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 5;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Create start and end points for the arc\n const startPoint: Point3 = [8, 0, 0];\n const endPoint: Point3 = [8, 0, 8];\n const centerPoint: Point3 = [0, 0, 0];\n\n // Create arc from circle and two points\n const arcOptions = new ArcEdgeCircleTwoPointsDto();\n arcOptions.circle = circle;\n arcOptions.start = startPoint;\n arcOptions.end = endPoint;\n arcOptions.sense = true;\n\n const arc = await bitbybit.occt.shapes.edge.arcFromCircleAndTwoPoints(arcOptions);\n // Draw the arc and helper points\n bitbybit.draw.drawAnyAsync({ entity: arc });\n bitbybit.draw.drawAnyAsync({ entity: [endPoint, centerPoint, startPoint] });\n bitbybit.draw.drawAnyAsync({ entity: [centerPoint, endPoint] });\n bitbybit.draw.drawAnyAsync({ entity: [centerPoint, startPoint] });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Arc edge from circle and two points" /> @@ -211,21 +211,21 @@ This example shows how to create an arc by extracting a portion of an existing c 500001045270TRUE","version":"0.20.14","type":"blockly"}} + script={{"script":"500001045270TRUE","version":"0.21.0","type":"blockly"}} title="Arc edge from circle and two points" /> {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 5;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Create arc from circle and two angles\n const arcOptions = new ArcEdgeCircleTwoAnglesDto();\n arcOptions.circle = circle;\n arcOptions.alphaAngle1 = 45;\n arcOptions.alphaAngle2 = 270;\n arcOptions.sense = true;\n\n const arc = await bitbybit.occt.shapes.edge.arcFromCircleAndTwoAngles(arcOptions);\n\n // Draw the arc\n bitbybit.draw.drawAnyAsync({ entity: arc });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const { CircleDto, ArcEdgeCircleTwoAnglesDto } = Bit.Inputs.OCCT;\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;\n\n\n// Define the main function\nconst start = async () => {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 5;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Create arc from circle and two angles\n const arcOptions = new ArcEdgeCircleTwoAnglesDto();\n arcOptions.circle = circle;\n arcOptions.alphaAngle1 = 45;\n arcOptions.alphaAngle2 = 270;\n arcOptions.sense = true;\n\n const arc = await bitbybit.occt.shapes.edge.arcFromCircleAndTwoAngles(arcOptions);\n\n // Draw the arc\n bitbybit.draw.drawAnyAsync({ entity: arc });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Arc edge from circle and two angles" /> @@ -252,21 +252,21 @@ This example demonstrates creating an arc by specifying a base circle and two an circlepointcenterPointarccircle5000010point808centerPoint000arccirclepoint360TRUEarccenterPointpointcenterPointpoint","version":"0.20.14","type":"blockly"}} + script={{"script":"circlepointcenterPointarccircle5000010point808centerPoint000arccirclepoint360TRUEarccenterPointpointcenterPointpoint","version":"0.21.0","type":"blockly"}} title="Arc edge from circle point and an angle" /> {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 5;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Create a point on the circle\n const point: Point3 = [8, 0, 8];\n const centerPoint: Point3 = [0, 0, 0];\n\n // Create arc from circle, point and angle\n const arcOptions = new ArcEdgeCirclePointAngleDto();\n arcOptions.circle = circle;\n arcOptions.point = point;\n arcOptions.alphaAngle = 360;\n arcOptions.sense = true;\n\n const arc = await bitbybit.occt.shapes.edge.arcFromCirclePointAndAngle(arcOptions);\n\n // Draw the arc and helper elements\n bitbybit.draw.drawAnyAsync({ entity: arc });\n bitbybit.draw.drawAnyAsync({ entity: [centerPoint, point] });\n bitbybit.draw.drawAnyAsync({ entity: [centerPoint] });\n bitbybit.draw.drawAnyAsync({ entity: [point] });\n\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const { CircleDto, ArcEdgeCirclePointAngleDto } = Bit.Inputs.OCCT;\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;\n\n// Define the main function\nconst start = async () => {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 5;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Create a point on the circle\n const point: Point3 = [8, 0, 8];\n const centerPoint: Point3 = [0, 0, 0];\n\n // Create arc from circle, point and angle\n const arcOptions = new ArcEdgeCirclePointAngleDto();\n arcOptions.circle = circle;\n arcOptions.point = point;\n arcOptions.alphaAngle = 360;\n arcOptions.sense = true;\n\n const arc = await bitbybit.occt.shapes.edge.arcFromCirclePointAndAngle(arcOptions);\n\n // Draw the arc and helper elements\n bitbybit.draw.drawAnyAsync({ entity: arc });\n bitbybit.draw.drawAnyAsync({ entity: [centerPoint, point] });\n bitbybit.draw.drawAnyAsync({ entity: [centerPoint] });\n bitbybit.draw.drawAnyAsync({ entity: [point] });\n\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Arc edge from circle point and an angle" /> @@ -294,21 +294,21 @@ This example shows how to create an arc starting from a specific point on a circ 5000010","version":"0.20.14","type":"blockly"}} + script={{"script":"5000010","version":"0.21.0","type":"blockly"}} title="Circle edge" /> {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 5;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Draw the circle\n bitbybit.draw.drawAnyAsync({ entity: circle });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const { CircleDto } = Bit.Inputs.OCCT;\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Define the main function\nconst start = async () => {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 5;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Draw the circle\n bitbybit.draw.drawAnyAsync({ entity: circle });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Circle edge" /> @@ -335,21 +335,21 @@ This example demonstrates creating a complete circular edge, which is one of the 000010310","version":"0.20.14","type":"blockly"}} + script={{"script":"000010310","version":"0.21.0","type":"blockly"}} title="Ellipse edge" /> {\n // Create an ellipse edge\n const ellipseOptions = new EllipseDto();\n ellipseOptions.center = [0, 0, 0] as Point3;\n ellipseOptions.direction = [0, 1, 0] as Vector3;\n ellipseOptions.radiusMinor = 3;\n ellipseOptions.radiusMajor = 10;\n\n const ellipse = await bitbybit.occt.shapes.edge.createEllipseEdge(ellipseOptions);\n\n // Draw the ellipse\n bitbybit.draw.drawAnyAsync({ entity: ellipse });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const { EllipseDto } = Bit.Inputs.OCCT;\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Define the main function\nconst start = async () => {\n // Create an ellipse edge\n const ellipseOptions = new EllipseDto();\n ellipseOptions.center = [0, 0, 0] as Point3;\n ellipseOptions.direction = [0, 1, 0] as Vector3;\n ellipseOptions.radiusMinor = 3;\n ellipseOptions.radiusMajor = 10;\n\n const ellipse = await bitbybit.occt.shapes.edge.createEllipseEdge(ellipseOptions);\n\n // Draw the ellipse\n bitbybit.draw.drawAnyAsync({ entity: ellipse });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Ellipse edge" /> diff --git a/docs/learn/code/common/occt/shapes/face/face-basic-primitives.md b/docs/learn/code/common/occt/shapes/face/face-basic-primitives.md index 7b2ca442..e349889d 100644 --- a/docs/learn/code/common/occt/shapes/face/face-basic-primitives.md +++ b/docs/learn/code/common/occt/shapes/face/face-basic-primitives.md @@ -26,21 +26,21 @@ Think of wires as the frame of a window, and faces as the glass that fills the f circleFacesquareFacerectangleFaceellipseFacecircleFace4000010squareFace3700010rectangleFace37-700010ellipseFace00-901013circleFacesquareFacerectangleFaceellipseFace","version":"0.20.14","type":"blockly"}} + script={{"script":"circleFacesquareFacerectangleFaceellipseFacecircleFace4000010squareFace3700010rectangleFace37-700010ellipseFace00-901013circleFacesquareFacerectangleFaceellipseFace","version":"0.21.0","type":"blockly"}} title="Creating basic face primitives" /> {\n // Create a circle face\n const circleOptions = new CircleDto();\n circleOptions.radius = 4;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circleFace = await face.createCircleFace(circleOptions);\n\n // Create a square face at a different position\n const squareOptions = new SquareDto();\n squareOptions.size = 3;\n squareOptions.center = [7, 0, 0] as Point3;\n squareOptions.direction = [0, 1, 0] as Vector3;\n\n const squareFace = await face.createSquareFace(squareOptions);\n\n // Create a rectangle face\n const rectangleOptions = new RectangleDto();\n rectangleOptions.width = 3;\n rectangleOptions.length = 7;\n rectangleOptions.center = [-7, 0, 0] as Point3;\n rectangleOptions.direction = [0, 1, 0] as Vector3;\n\n const rectangleFace = await face.createRectangleFace(rectangleOptions);\n\n // Create an ellipse face\n const ellipseOptions = new EllipseDto();\n ellipseOptions.center = [0, 0, -9] as Point3;\n ellipseOptions.direction = [0, 1, 0] as Vector3;\n ellipseOptions.radiusMinor = 1;\n ellipseOptions.radiusMajor = 3;\n\n const ellipseFace = await face.createEllipseFace(ellipseOptions);\n\n // Draw all the created faces\n bitbybit.draw.drawAnyAsync({ entity: circleFace });\n bitbybit.draw.drawAnyAsync({ entity: squareFace });\n bitbybit.draw.drawAnyAsync({ entity: rectangleFace });\n bitbybit.draw.drawAnyAsync({ entity: ellipseFace });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs and types for face creation\nconst { CircleDto, SquareDto, RectangleDto, EllipseDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Get access to OCCT face creation functions\nconst { face } = bitbybit.occt.shapes;\n\n// Define the main function to create various primitive faces\nconst start = async () => {\n // Create a circle face\n const circleOptions = new CircleDto();\n circleOptions.radius = 4;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circleFace = await face.createCircleFace(circleOptions);\n\n // Create a square face at a different position\n const squareOptions = new SquareDto();\n squareOptions.size = 3;\n squareOptions.center = [7, 0, 0] as Point3;\n squareOptions.direction = [0, 1, 0] as Vector3;\n\n const squareFace = await face.createSquareFace(squareOptions);\n\n // Create a rectangle face\n const rectangleOptions = new RectangleDto();\n rectangleOptions.width = 3;\n rectangleOptions.length = 7;\n rectangleOptions.center = [-7, 0, 0] as Point3;\n rectangleOptions.direction = [0, 1, 0] as Vector3;\n\n const rectangleFace = await face.createRectangleFace(rectangleOptions);\n\n // Create an ellipse face\n const ellipseOptions = new EllipseDto();\n ellipseOptions.center = [0, 0, -9] as Point3;\n ellipseOptions.direction = [0, 1, 0] as Vector3;\n ellipseOptions.radiusMinor = 1;\n ellipseOptions.radiusMajor = 3;\n\n const ellipseFace = await face.createEllipseFace(ellipseOptions);\n\n // Draw all the created faces\n bitbybit.draw.drawAnyAsync({ entity: circleFace });\n bitbybit.draw.drawAnyAsync({ entity: squareFace });\n bitbybit.draw.drawAnyAsync({ entity: rectangleFace });\n bitbybit.draw.drawAnyAsync({ entity: ellipseFace });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Creating basic face primitives" /> diff --git a/docs/learn/code/common/occt/shapes/face/face-from-points.md b/docs/learn/code/common/occt/shapes/face/face-from-points.md index a88df16f..d769cf04 100644 --- a/docs/learn/code/common/occt/shapes/face/face-from-points.md +++ b/docs/learn/code/common/occt/shapes/face/face-from-points.md @@ -28,21 +28,21 @@ This example demonstrates creating a quadrilateral face from four strategically point1point2point3point4pointsListpolygonFacepoint1-30-8point2-303point3303point4500pointsListpoint1point2point3point4polygonFacepointsListpolygonFacepointsList","version":"0.20.14","type":"blockly"}} + script={{"script":"point1point2point3point4pointsListpolygonFacepoint1-30-8point2-303point3303point4500pointsListpoint1point2point3point4polygonFacepointsListpolygonFacepointsList","version":"0.21.0","type":"blockly"}} title="Creating face from points" /> {\n // Define the four points that will form the polygon face\n const point1: Point3 = [-3, 0, -8];\n const point2: Point3 = [-3, 0, 3];\n const point3: Point3 = [3, 0, 3];\n const point4: Point3 = [5, 0, 0];\n\n // Create a list of points in the correct order\n const points: Point3[] = [point1, point2, point3, point4];\n\n // Create the polygon face options\n const polygonOptions = new PolygonDto();\n polygonOptions.points = points;\n\n // Create the polygon face from the points\n const polygonFace = await face.createPolygonFace(polygonOptions);\n\n // Draw the polygon face\n bitbybit.draw.drawAnyAsync({ entity: polygonFace });\n\n // Optionally, draw the points to visualize the vertices\n bitbybit.draw.drawAnyAsync({ entity: points });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs and types for polygon face creation\nconst { PolygonDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\n\n// Get access to OCCT face creation functions\nconst { face } = bitbybit.occt.shapes;\n\n// Define the main function to create a polygon face from points\nconst start = async () => {\n // Define the four points that will form the polygon face\n const point1: Point3 = [-3, 0, -8];\n const point2: Point3 = [-3, 0, 3];\n const point3: Point3 = [3, 0, 3];\n const point4: Point3 = [5, 0, 0];\n\n // Create a list of points in the correct order\n const points: Point3[] = [point1, point2, point3, point4];\n\n // Create the polygon face options\n const polygonOptions = new PolygonDto();\n polygonOptions.points = points;\n\n // Create the polygon face from the points\n const polygonFace = await face.createPolygonFace(polygonOptions);\n\n // Draw the polygon face\n bitbybit.draw.drawAnyAsync({ entity: polygonFace });\n\n // Optionally, draw the points to visualize the vertices\n bitbybit.draw.drawAnyAsync({ entity: points });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Creating face from points" /> diff --git a/docs/learn/code/common/occt/shapes/face/face-from-wire.md b/docs/learn/code/common/occt/shapes/face/face-from-wire.md index 41ceca58..eca1050f 100644 --- a/docs/learn/code/common/occt/shapes/face/face-from-wire.md +++ b/docs/learn/code/common/occt/shapes/face/face-from-wire.md @@ -36,21 +36,21 @@ This example demonstrates creating a star-shaped face from a reversed wire to co starWirereversedWirefaceFromWirestarWire0000107730FALSEreversedWirestarWirefaceFromWirereversedWireTRUEfaceFromWire","version":"0.20.14","type":"blockly"}} + script={{"script":"starWirereversedWirefaceFromWirestarWire0000107730FALSEreversedWirestarWirefaceFromWirereversedWireTRUEfaceFromWire","version":"0.21.0","type":"blockly"}} title="Creating face from wire" /> {\n // Create a star wire\n const starOptions = new StarDto();\n starOptions.center = [0, 0, 0] as Point3;\n starOptions.direction = [0, 1, 0] as Vector3;\n starOptions.numRays = 7;\n starOptions.outerRadius = 7;\n starOptions.innerRadius = 3;\n starOptions.offsetOuterEdges = 0;\n starOptions.half = false;\n\n const starWire = await wire.createStarWire(starOptions);\n\n // Reverse the wire orientation\n const reversedWire = await wire.reversedWire({ shape: starWire });\n\n // Create a face from the reversed wire\n const faceOptions = new FaceFromWireDto();\n faceOptions.shape = reversedWire;\n faceOptions.planar = true;\n\n const faceFromWire = await face.createFaceFromWire(faceOptions);\n\n // Draw the created face\n bitbybit.draw.drawAnyAsync({ entity: faceFromWire });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs and types for wire and face creation\nconst { StarDto, FaceFromWireDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\n\n// Get access to OCCT wire and face creation functions\nconst { wire, face } = bitbybit.occt.shapes;\n\n// Define the main function to create a face from a wire\nconst start = async () => {\n // Create a star wire\n const starOptions = new StarDto();\n starOptions.center = [0, 0, 0] as Point3;\n starOptions.direction = [0, 1, 0] as Vector3;\n starOptions.numRays = 7;\n starOptions.outerRadius = 7;\n starOptions.innerRadius = 3;\n starOptions.offsetOuterEdges = 0;\n starOptions.half = false;\n\n const starWire = await wire.createStarWire(starOptions);\n\n // Reverse the wire orientation\n const reversedWire = await wire.reversedWire({ shape: starWire });\n\n // Create a face from the reversed wire\n const faceOptions = new FaceFromWireDto();\n faceOptions.shape = reversedWire;\n faceOptions.planar = true;\n\n const faceFromWire = await face.createFaceFromWire(faceOptions);\n\n // Draw the created face\n bitbybit.draw.drawAnyAsync({ entity: faceFromWire });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Creating face from wire" /> diff --git a/docs/learn/code/common/occt/shapes/face/face-hex-grid-pattern.md b/docs/learn/code/common/occt/shapes/face/face-hex-grid-pattern.md index d2269674..5a3f2f86 100644 --- a/docs/learn/code/common/occt/shapes/face/face-hex-grid-pattern.md +++ b/docs/learn/code/common/occt/shapes/face/face-hex-grid-pattern.md @@ -23,21 +23,21 @@ Learn how to create hexagonal face patterns that respond to a control point. Hex gridWidthgridHeighthexagonsInWidthhexagonsInHeightcontrolPointUcontrolPointVrectangleFacecontrolPointhexGridhexCentersdistancesminDistancemaxDistancescalePatterndistancescaledValueinclusionPatternhexagonFacesaffectorPointpingridWidth16.5gridHeight9hexagonsInWidth29hexagonsInHeight29controlPointU0controlPointV0.49rectangleFacegridWidthgridHeight000010controlPointrectangleFacecontrolPointUcontrolPointVhexGridgridWidthgridHeighthexagonsInWidthhexagonsInHeightTRUEFALSEFALSEFALSEFALSETRUETRUEhexCentershexGridcentersdistancescontrolPointhexCentersminDistancedistancesmaxDistancedistancesscalePatterndistancedistancesscaledValuedistanceminDistancemaxDistance0.2110.9INSERTLASTscalePatternscaledValueinclusionPattern[true, true, true, true, false]hexagonFacesgridWidthgridHeighthexagonsInWidthhexagonsInHeightTRUEFALSEFALSEFALSEFALSEscalePatternscalePatterninclusionPatternaffectorPointcontrolPoint030pincontrolPointaffectorPoint0010.1Affector0.30.1hexagonFacespincontrolPoint","version":"0.20.14","type":"blockly"}} + script={{"script":"gridWidthgridHeighthexagonsInWidthhexagonsInHeightcontrolPointUcontrolPointVrectangleFacecontrolPointhexGridhexCentersdistancesminDistancemaxDistancescalePatterndistancescaledValueinclusionPatternhexagonFacesaffectorPointpingridWidth16.5gridHeight9hexagonsInWidth29hexagonsInHeight29controlPointU0controlPointV0.49rectangleFacegridWidthgridHeight000010controlPointrectangleFacecontrolPointUcontrolPointVhexGridgridWidthgridHeighthexagonsInWidthhexagonsInHeightTRUEFALSEFALSEFALSEFALSETRUETRUEhexCentershexGridcentersdistancescontrolPointhexCentersminDistancedistancesmaxDistancedistancesscalePatterndistancedistancesscaledValuedistanceminDistancemaxDistance0.2110.9INSERTLASTscalePatternscaledValueinclusionPattern[true, true, true, true, false]hexagonFacesgridWidthgridHeighthexagonsInWidthhexagonsInHeightTRUEFALSEFALSEFALSEFALSEscalePatternscalePatterninclusionPatternaffectorPointcontrolPoint030pincontrolPointaffectorPoint0010.1Affector0.30.1hexagonFacespincontrolPoint","version":"0.21.0","type":"blockly"}} title="Creating face from wire" /> {\n // Define grid parameters\n const gridWidth = 16.5;\n const gridHeight = 9;\n const hexagonsInWidth = 29;\n const hexagonsInHeight = 29;\n const controlPointU = 0; // UV parameter for control point position\n const controlPointV = 0.49; // UV parameter for control point position\n\n // Create a reference rectangle face to define the control point\n const rectangleOptions = new RectangleDto();\n rectangleOptions.width = gridWidth;\n rectangleOptions.length = gridHeight;\n rectangleOptions.center = [0, 0, 0] as Point3;\n rectangleOptions.direction = [0, 1, 0] as Vector3;\n\n const rectangleFace = await face.createRectangleFace(rectangleOptions);\n\n // Create control point on the rectangle face using UV parameters\n const pointOnUVOptions = new DataOnUVDto();\n pointOnUVOptions.shape = rectangleFace;\n pointOnUVOptions.paramU = controlPointU;\n pointOnUVOptions.paramV = controlPointV;\n\n const controlPoint = await face.pointOnUV(pointOnUVOptions);\n\n // Generate hexagon grid centers for distance calculation\n const hexGridOptions = new HexGridScaledToFitDto();\n hexGridOptions.width = gridWidth;\n hexGridOptions.height = gridHeight;\n hexGridOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridOptions.flatTop = true;\n hexGridOptions.extendTop = false;\n hexGridOptions.extendBottom = false;\n hexGridOptions.extendLeft = false;\n hexGridOptions.extendRight = false;\n hexGridOptions.centerGrid = true;\n hexGridOptions.pointsOnGround = true;\n\n const hexGrid = point.hexGridScaledToFit(hexGridOptions);\n const hexCenters = hexGrid.centers;\n\n // Calculate distances from control point to all hexagon centers\n const distances = point.distancesToPoints({\n startPoint: controlPoint,\n endPoints: hexCenters\n });\n\n // Flatten the distance array and find min/max values\n const minDistance = vector.min({ vector: distances });\n const maxDistance = vector.max({ vector: distances });\n\n // Remap distances to scale factors (0.211 to 0.9)\n const remapOptions = new RemapNumberDto();\n remapOptions.fromLow = minDistance;\n remapOptions.fromHigh = maxDistance;\n remapOptions.toLow = 0.211;\n remapOptions.toHigh = 0.9;\n\n const scalePattern = distances.map(x => {\n remapOptions.number = x;\n return math.remap(remapOptions);\n })\n\n // Create inclusion pattern for selective hexagon removal\n const inclusionPattern = json.parse({ text: \"[true, true, true, true, false]\" });\n\n // Create the hexagon faces with advanced patterns\n const hexFaceOptions = new HexagonsInGridDto();\n hexFaceOptions.width = gridWidth;\n hexFaceOptions.height = gridHeight;\n hexFaceOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexFaceOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexFaceOptions.flatTop = true;\n hexFaceOptions.extendTop = false;\n hexFaceOptions.extendBottom = false;\n hexFaceOptions.extendLeft = false;\n hexFaceOptions.extendRight = false;\n hexFaceOptions.scalePatternWidth = scalePattern;\n hexFaceOptions.scalePatternHeight = scalePattern;\n hexFaceOptions.inclusionPattern = inclusionPattern;\n\n const hexagonFaces = await face.hexagonsInGrid(hexFaceOptions);\n\n // Create affector point visualization (control point elevated)\n const affectorPoint = vector.add({\n first: controlPoint,\n second: [0, 3, 0] as Vector3\n }) as Point3;\n\n // Create pin with label to show the affector point\n const pinOptions = new PinWithLabelDto();\n pinOptions.startPoint = controlPoint;\n pinOptions.endPoint = affectorPoint;\n pinOptions.direction = [0, 0, 1] as Vector3;\n pinOptions.offsetFromStart = 0.1;\n pinOptions.label = \"Affector\";\n pinOptions.labelOffset = 0.3;\n pinOptions.labelSize = 0.1;\n\n const pin = await dimensions.pinWithLabel(pinOptions);\n\n // Draw the hexagon faces and affector pin\n bitbybit.draw.drawAnyAsync({ entity: hexagonFaces });\n bitbybit.draw.drawAnyAsync({ entity: pin });\n\n // Optional: Draw the control point for reference\n bitbybit.draw.drawAnyAsync({\n entity: controlPoint,\n });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs and types for face hexagon grid creation\nconst { HexagonsInGridDto, RectangleDto, DataOnUVDto, PinWithLabelDto } = Bit.Inputs.OCCT;\nconst { HexGridScaledToFitDto } = Bit.Inputs.Point;\nconst { RemapNumberDto } = Bit.Inputs.Math;\nconst { HexGridData } = Bit.Models.Point;\n\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\n\n// Get access to OCCT face, point, and utility functions\nconst { face } = bitbybit.occt.shapes;\nconst { point } = bitbybit;\nconst { math, vector, json, lists } = bitbybit;\nconst { dimensions } = bitbybit.occt;\n\n// Define the main function to create advanced hexagon face pattern\nconst start = async () => {\n // Define grid parameters\n const gridWidth = 16.5;\n const gridHeight = 9;\n const hexagonsInWidth = 29;\n const hexagonsInHeight = 29;\n const controlPointU = 0; // UV parameter for control point position\n const controlPointV = 0.49; // UV parameter for control point position\n\n // Create a reference rectangle face to define the control point\n const rectangleOptions = new RectangleDto();\n rectangleOptions.width = gridWidth;\n rectangleOptions.length = gridHeight;\n rectangleOptions.center = [0, 0, 0] as Point3;\n rectangleOptions.direction = [0, 1, 0] as Vector3;\n\n const rectangleFace = await face.createRectangleFace(rectangleOptions);\n\n // Create control point on the rectangle face using UV parameters\n const pointOnUVOptions = new DataOnUVDto();\n pointOnUVOptions.shape = rectangleFace;\n pointOnUVOptions.paramU = controlPointU;\n pointOnUVOptions.paramV = controlPointV;\n\n const controlPoint = await face.pointOnUV(pointOnUVOptions);\n\n // Generate hexagon grid centers for distance calculation\n const hexGridOptions = new HexGridScaledToFitDto();\n hexGridOptions.width = gridWidth;\n hexGridOptions.height = gridHeight;\n hexGridOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridOptions.flatTop = true;\n hexGridOptions.extendTop = false;\n hexGridOptions.extendBottom = false;\n hexGridOptions.extendLeft = false;\n hexGridOptions.extendRight = false;\n hexGridOptions.centerGrid = true;\n hexGridOptions.pointsOnGround = true;\n\n const hexGrid = point.hexGridScaledToFit(hexGridOptions);\n const hexCenters = hexGrid.centers;\n\n // Calculate distances from control point to all hexagon centers\n const distances = point.distancesToPoints({\n startPoint: controlPoint,\n endPoints: hexCenters\n });\n\n // Flatten the distance array and find min/max values\n const minDistance = vector.min({ vector: distances });\n const maxDistance = vector.max({ vector: distances });\n\n // Remap distances to scale factors (0.211 to 0.9)\n const remapOptions = new RemapNumberDto();\n remapOptions.fromLow = minDistance;\n remapOptions.fromHigh = maxDistance;\n remapOptions.toLow = 0.211;\n remapOptions.toHigh = 0.9;\n\n const scalePattern = distances.map(x => {\n remapOptions.number = x;\n return math.remap(remapOptions);\n })\n\n // Create inclusion pattern for selective hexagon removal\n const inclusionPattern = json.parse({ text: \"[true, true, true, true, false]\" });\n\n // Create the hexagon faces with advanced patterns\n const hexFaceOptions = new HexagonsInGridDto();\n hexFaceOptions.width = gridWidth;\n hexFaceOptions.height = gridHeight;\n hexFaceOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexFaceOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexFaceOptions.flatTop = true;\n hexFaceOptions.extendTop = false;\n hexFaceOptions.extendBottom = false;\n hexFaceOptions.extendLeft = false;\n hexFaceOptions.extendRight = false;\n hexFaceOptions.scalePatternWidth = scalePattern;\n hexFaceOptions.scalePatternHeight = scalePattern;\n hexFaceOptions.inclusionPattern = inclusionPattern;\n\n const hexagonFaces = await face.hexagonsInGrid(hexFaceOptions);\n\n // Create affector point visualization (control point elevated)\n const affectorPoint = vector.add({\n first: controlPoint,\n second: [0, 3, 0] as Vector3\n }) as Point3;\n\n // Create pin with label to show the affector point\n const pinOptions = new PinWithLabelDto();\n pinOptions.startPoint = controlPoint;\n pinOptions.endPoint = affectorPoint;\n pinOptions.direction = [0, 0, 1] as Vector3;\n pinOptions.offsetFromStart = 0.1;\n pinOptions.label = \"Affector\";\n pinOptions.labelOffset = 0.3;\n pinOptions.labelSize = 0.1;\n\n const pin = await dimensions.pinWithLabel(pinOptions);\n\n // Draw the hexagon faces and affector pin\n bitbybit.draw.drawAnyAsync({ entity: hexagonFaces });\n bitbybit.draw.drawAnyAsync({ entity: pin });\n\n // Optional: Draw the control point for reference\n bitbybit.draw.drawAnyAsync({\n entity: controlPoint,\n });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Creating face from wire" /> diff --git a/docs/learn/code/common/occt/shapes/shells/intro-shells.md b/docs/learn/code/common/occt/shapes/shells/intro-shells.md index 3c358250..4946f8d5 100644 --- a/docs/learn/code/common/occt/shapes/shells/intro-shells.md +++ b/docs/learn/code/common/occt/shapes/shells/intro-shells.md @@ -40,21 +40,21 @@ This first example demonstrates the fundamental concept of shell creation by sew sizeface1face2rotatedFace2translatedFace2facesshellsize5face1size000010face2size000010rotatedFace2face200190translatedFace2rotatedFace2DIVIDEsize2DIVIDEsize20facesface1translatedFace2shellfaces0.0000001shell","version":"0.20.14","type":"blockly"}} + script={{"script":"sizeface1face2rotatedFace2translatedFace2facesshellsize5face1size000010face2size000010rotatedFace2face200190translatedFace2rotatedFace2DIVIDEsize2DIVIDEsize20facesface1translatedFace2shellfaces0.0000001shell","version":"0.21.0","type":"blockly"}} title="Creating shells by sewing two square faces" /> {\n // Define the size for both square faces\n const size = 5;\n\n // Create first square face at origin\n const face1Options = new SquareDto();\n face1Options.size = size;\n face1Options.center = [0, 0, 0] as Point3;\n face1Options.direction = [0, 1, 0] as Vector3; // Y-up orientation\n\n const face1 = await face.createSquareFace(face1Options);\n\n // Create second square face (initially identical to first)\n const face2Options = new SquareDto();\n face2Options.size = size;\n face2Options.center = [0, 0, 0] as Point3;\n face2Options.direction = [0, 1, 0] as Vector3;\n\n const face2 = await face.createSquareFace(face2Options);\n\n // Rotate the second face 90 degrees around Z-axis to create perpendicular orientation\n const rotateOptions = new RotateDto();\n rotateOptions.shape = face2;\n rotateOptions.axis = [0, 0, 1] as Vector3; // Z-axis\n rotateOptions.angle = 90; // 90 degrees\n\n const rotatedFace2 = await transforms.rotate(rotateOptions);\n\n // Translate the rotated face to share an edge with the first face\n const translateOptions = new TranslateDto();\n translateOptions.shape = rotatedFace2;\n translateOptions.translation = [size / 2, size / 2, 0] as Vector3;\n\n const translatedFace2 = await transforms.translate(translateOptions);\n\n // Create array of faces to sew together\n const faces = [face1, translatedFace2];\n\n // Sew the faces together to create a shell\n const sewOptions = new SewDto(faces);\n sewOptions.tolerance = 1e-7; // Very tight tolerance for precise sewing\n\n const resultShell = await shell.sewFaces(sewOptions);\n\n // Verify that we created a shell (not just individual faces)\n const shapeType = await shape.getShapeType({ shape: resultShell });\n console.log('Shell shape type:', shapeType); // Should output \"shell\"\n\n // Draw the resulting shell\n bitbybit.draw.drawAnyAsync({\n entity: resultShell\n });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs for creating faces, shells, and transformations\nconst { SquareDto, SewDto, RotateDto, TranslateDto } = Bit.Inputs.OCCT;\n// Import type definitions for type safety\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSShellPointer = Bit.Inputs.OCCT.TopoDSShellPointer;\n\n// Get access to OCCT modules and utility functions\nconst { face, shell, shape } = bitbybit.occt.shapes;\nconst { transforms } = bitbybit.occt;\n\n// Define the main function to create a simple shell from two faces\nconst start = async () => {\n // Define the size for both square faces\n const size = 5;\n\n // Create first square face at origin\n const face1Options = new SquareDto();\n face1Options.size = size;\n face1Options.center = [0, 0, 0] as Point3;\n face1Options.direction = [0, 1, 0] as Vector3; // Y-up orientation\n\n const face1 = await face.createSquareFace(face1Options);\n\n // Create second square face (initially identical to first)\n const face2Options = new SquareDto();\n face2Options.size = size;\n face2Options.center = [0, 0, 0] as Point3;\n face2Options.direction = [0, 1, 0] as Vector3;\n\n const face2 = await face.createSquareFace(face2Options);\n\n // Rotate the second face 90 degrees around Z-axis to create perpendicular orientation\n const rotateOptions = new RotateDto();\n rotateOptions.shape = face2;\n rotateOptions.axis = [0, 0, 1] as Vector3; // Z-axis\n rotateOptions.angle = 90; // 90 degrees\n\n const rotatedFace2 = await transforms.rotate(rotateOptions);\n\n // Translate the rotated face to share an edge with the first face\n const translateOptions = new TranslateDto();\n translateOptions.shape = rotatedFace2;\n translateOptions.translation = [size / 2, size / 2, 0] as Vector3;\n\n const translatedFace2 = await transforms.translate(translateOptions);\n\n // Create array of faces to sew together\n const faces = [face1, translatedFace2];\n\n // Sew the faces together to create a shell\n const sewOptions = new SewDto(faces);\n sewOptions.tolerance = 1e-7; // Very tight tolerance for precise sewing\n\n const resultShell = await shell.sewFaces(sewOptions);\n\n // Verify that we created a shell (not just individual faces)\n const shapeType = await shape.getShapeType({ shape: resultShell });\n console.log('Shell shape type:', shapeType); // Should output \"shell\"\n\n // Draw the resulting shell\n bitbybit.draw.drawAnyAsync({\n entity: resultShell\n });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Creating shells by sewing two square faces" /> @@ -81,21 +81,21 @@ While this cylindrical solid **can be constructed in Bitbybit using the simple s radiusheightcircleWireextrusionVectorcylindricalSurfacebottomFacetopFacefacesshellsolidradius5height5circleWireradius000010extrusionVector0height0cylindricalSurfacecircleWireextrusionVectorbottomFacecircleWireTRUEtopFacebottomFaceextrusionVectorfacestopFacecylindricalSurfacebottomFaceshellfaces1e-7solidshellsolid","version":"0.20.14","type":"blockly"}} + script={{"script":"radiusheightcircleWireextrusionVectorcylindricalSurfacebottomFacetopFacefacesshellsolidradius5height5circleWireradius000010extrusionVector0height0cylindricalSurfacecircleWireextrusionVectorbottomFacecircleWireTRUEtopFacebottomFaceextrusionVectorfacestopFacecylindricalSurfacebottomFaceshellfaces1e-7solidshellsolid","version":"0.21.0","type":"blockly"}} title="Creating closed shells and converting to solids" /> {\n // Define geometric parameters\n const radius = 5;\n const height = 5;\n\n // Step 1: Create base circle wire\n const circleOptions = new CircleDto();\n circleOptions.radius = radius;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3; // Y-up orientation\n\n const circleWire = await wire.createCircleWire(circleOptions);\n\n // Step 2: Create extrusion vector for cylindrical surface\n const extrusionVector: Vector3 = [0, height, 0];\n\n // Step 3: Create cylindrical surface by extruding the circle wire\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = circleWire;\n extrudeOptions.direction = extrusionVector;\n\n const cylindricalSurface = await operations.extrude(extrudeOptions);\n\n // Step 4: Create bottom face from the circle wire\n const bottomFaceOptions = new FaceFromWireDto();\n bottomFaceOptions.shape = circleWire;\n bottomFaceOptions.planar = true; // Ensure flat circular face\n\n const bottomFace = await face.createFaceFromWire(bottomFaceOptions);\n\n // Step 5: Create top face by translating bottom face\n const translateOptions = new TranslateDto();\n translateOptions.shape = bottomFace;\n translateOptions.translation = extrusionVector;\n\n const topFace = await transforms.translate(translateOptions);\n\n // Step 6: Collect all faces that will form the closed shell\n const faces = [topFace, cylindricalSurface, bottomFace];\n\n // Step 7: Sew faces together to create a closed shell\n const sewOptions = new SewDto(faces);\n sewOptions.tolerance = 1e-7; // High precision for closed shell\n\n const closedShell = await shell.sewFaces(sewOptions);\n\n // Step 8: Convert closed shell to solid\n const solidOptions = new ShapeDto();\n solidOptions.shape = closedShell;\n\n const cylinderSolid = await solid.fromClosedShell(solidOptions);\n\n // Step 9: Verify the shape types\n const shellType = await shape.getShapeType({ shape: closedShell });\n const solidType = await shape.getShapeType({ shape: cylinderSolid });\n\n console.log('Shell type:', shellType); // Should output \"shell\"\n console.log('Solid type:', solidType); // Should output \"solid\"\n\n // Step 10: Draw the final solid\n bitbybit.draw.drawAnyAsync({\n entity: cylinderSolid\n });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs for creating complex geometries\nconst { CircleDto, FaceFromWireDto, ShapeDto, SewDto, ExtrudeDto, TranslateDto } = Bit.Inputs.OCCT;\n\n// Import type definitions for type safety\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSShellPointer = Bit.Inputs.OCCT.TopoDSShellPointer;\n\n// Get access to OCCT modules and utility functions\nconst { wire, face, shell, solid, shape } = bitbybit.occt.shapes;\nconst { operations, transforms } = bitbybit.occt;\n\n// Define the main function to create a complex shell and convert to solid\nconst start = async () => {\n // Define geometric parameters\n const radius = 5;\n const height = 5;\n\n // Step 1: Create base circle wire\n const circleOptions = new CircleDto();\n circleOptions.radius = radius;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3; // Y-up orientation\n\n const circleWire = await wire.createCircleWire(circleOptions);\n\n // Step 2: Create extrusion vector for cylindrical surface\n const extrusionVector: Vector3 = [0, height, 0];\n\n // Step 3: Create cylindrical surface by extruding the circle wire\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = circleWire;\n extrudeOptions.direction = extrusionVector;\n\n const cylindricalSurface = await operations.extrude(extrudeOptions);\n\n // Step 4: Create bottom face from the circle wire\n const bottomFaceOptions = new FaceFromWireDto();\n bottomFaceOptions.shape = circleWire;\n bottomFaceOptions.planar = true; // Ensure flat circular face\n\n const bottomFace = await face.createFaceFromWire(bottomFaceOptions);\n\n // Step 5: Create top face by translating bottom face\n const translateOptions = new TranslateDto();\n translateOptions.shape = bottomFace;\n translateOptions.translation = extrusionVector;\n\n const topFace = await transforms.translate(translateOptions);\n\n // Step 6: Collect all faces that will form the closed shell\n const faces = [topFace, cylindricalSurface, bottomFace];\n\n // Step 7: Sew faces together to create a closed shell\n const sewOptions = new SewDto(faces);\n sewOptions.tolerance = 1e-7; // High precision for closed shell\n\n const closedShell = await shell.sewFaces(sewOptions);\n\n // Step 8: Convert closed shell to solid\n const solidOptions = new ShapeDto();\n solidOptions.shape = closedShell;\n\n const cylinderSolid = await solid.fromClosedShell(solidOptions);\n\n // Step 9: Verify the shape types\n const shellType = await shape.getShapeType({ shape: closedShell });\n const solidType = await shape.getShapeType({ shape: cylinderSolid });\n\n console.log('Shell type:', shellType); // Should output \"shell\"\n console.log('Solid type:', solidType); // Should output \"solid\"\n\n // Step 10: Draw the final solid\n bitbybit.draw.drawAnyAsync({\n entity: cylinderSolid\n });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Creating closed shells and converting to solids" /> diff --git a/docs/learn/code/common/occt/shapes/solids/intro-solids.md b/docs/learn/code/common/occt/shapes/solids/intro-solids.md index 2f5c970c..f54fba82 100644 --- a/docs/learn/code/common/occt/shapes/solids/intro-solids.md +++ b/docs/learn/code/common/occt/shapes/solids/intro-solids.md @@ -32,21 +32,21 @@ This example demonstrates the creation of the most common primitive solid types: boxcubecylindersphereconebox378000TRUEcube5500TRUEcylinder23-500010360TRUEsphere1.51000cone213360-1000010boxcubecylinderspherecone","version":"0.20.14","type":"blockly"}} + script={{"script":"boxcubecylindersphereconebox378000TRUEcube5500TRUEcylinder23-500010360TRUEsphere1.51000cone213360-1000010boxcubecylinderspherecone","version":"0.21.0","type":"blockly"}} title="Creating primitive solids" /> {\n // Create a rectangular box\n const boxOptions = new BoxDto();\n boxOptions.width = 3;\n boxOptions.length = 7;\n boxOptions.height = 8;\n boxOptions.center = [0, 0, 0] as Point3;\n boxOptions.originOnCenter = true;\n \n const box = await solid.createBox(boxOptions);\n \n // Create a cube at a different position\n const cubeOptions = new CubeDto();\n cubeOptions.size = 5;\n cubeOptions.center = [5, 0, 0] as Point3;\n cubeOptions.originOnCenter = true;\n \n const cube = await solid.createCube(cubeOptions);\n \n // Create a cylinder\n const cylinderOptions = new CylinderDto();\n cylinderOptions.radius = 2;\n cylinderOptions.height = 3;\n cylinderOptions.center = [-5, 0, 0] as Point3;\n cylinderOptions.direction = [0, 1, 0] as Vector3;\n cylinderOptions.angle = 360;\n cylinderOptions.originOnCenter = true;\n \n const cylinder = await solid.createCylinder(cylinderOptions);\n \n // Create a sphere\n const sphereOptions = new SphereDto();\n sphereOptions.radius = 1.5;\n sphereOptions.center = [10, 0, 0] as Point3;\n \n const sphere = await solid.createSphere(sphereOptions);\n \n // Create a cone\n const coneOptions = new ConeDto();\n coneOptions.radius1 = 2;\n coneOptions.radius2 = 1;\n coneOptions.height = 3;\n coneOptions.angle = 360;\n coneOptions.center = [-10, 0, 0] as Point3;\n coneOptions.direction = [0, 1, 0] as Vector3;\n \n const cone = await solid.createCone(coneOptions);\n \n // Draw all the created solids\n bitbybit.draw.drawAnyAsync({ entity: box });\n bitbybit.draw.drawAnyAsync({ entity: cube });\n bitbybit.draw.drawAnyAsync({ entity: cylinder });\n bitbybit.draw.drawAnyAsync({ entity: sphere });\n bitbybit.draw.drawAnyAsync({ entity: cone });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs and types for solid creation\nconst { BoxDto, CubeDto, CylinderDto, SphereDto, ConeDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Get access to OCCT solid creation functions\nconst { solid } = bitbybit.occt.shapes;\n\n// Define the main function to create various primitive solids\nconst start = async () => {\n // Create a rectangular box\n const boxOptions = new BoxDto();\n boxOptions.width = 3;\n boxOptions.length = 7;\n boxOptions.height = 8;\n boxOptions.center = [0, 0, 0] as Point3;\n boxOptions.originOnCenter = true;\n \n const box = await solid.createBox(boxOptions);\n \n // Create a cube at a different position\n const cubeOptions = new CubeDto();\n cubeOptions.size = 5;\n cubeOptions.center = [5, 0, 0] as Point3;\n cubeOptions.originOnCenter = true;\n \n const cube = await solid.createCube(cubeOptions);\n \n // Create a cylinder\n const cylinderOptions = new CylinderDto();\n cylinderOptions.radius = 2;\n cylinderOptions.height = 3;\n cylinderOptions.center = [-5, 0, 0] as Point3;\n cylinderOptions.direction = [0, 1, 0] as Vector3;\n cylinderOptions.angle = 360;\n cylinderOptions.originOnCenter = true;\n \n const cylinder = await solid.createCylinder(cylinderOptions);\n \n // Create a sphere\n const sphereOptions = new SphereDto();\n sphereOptions.radius = 1.5;\n sphereOptions.center = [10, 0, 0] as Point3;\n \n const sphere = await solid.createSphere(sphereOptions);\n \n // Create a cone\n const coneOptions = new ConeDto();\n coneOptions.radius1 = 2;\n coneOptions.radius2 = 1;\n coneOptions.height = 3;\n coneOptions.angle = 360;\n coneOptions.center = [-10, 0, 0] as Point3;\n coneOptions.direction = [0, 1, 0] as Vector3;\n \n const cone = await solid.createCone(coneOptions);\n \n // Draw all the created solids\n bitbybit.draw.drawAnyAsync({ entity: box });\n bitbybit.draw.drawAnyAsync({ entity: cube });\n bitbybit.draw.drawAnyAsync({ entity: cylinder });\n bitbybit.draw.drawAnyAsync({ entity: sphere });\n bitbybit.draw.drawAnyAsync({ entity: cone });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Creating primitive solids" /> diff --git a/docs/learn/code/common/occt/shapes/solids/volume-and-surface-area.md b/docs/learn/code/common/occt/shapes/solids/volume-and-surface-area.md index 474ca29d..f2b71927 100644 --- a/docs/learn/code/common/occt/shapes/solids/volume-and-surface-area.md +++ b/docs/learn/code/common/occt/shapes/solids/volume-and-surface-area.md @@ -32,21 +32,21 @@ The example shows a practical workflow for measuring and displaying geometric pr heightconevolumesurfaceArearoundedVolumeroundedSurfaceAreavolumeTextareaTextvolumePinareaPinheight5cone21height360000010volumeconesurfaceAreaconeroundedVolumevolume2roundedSurfaceAreasurfaceArea2volumeTextVolume {0} m3roundedVolumeareaTextArea {0} m3roundedSurfaceAreavolumePin0height01ADDheight301000volumeText0.30.3areaPin0height01ADDheight401000areaText0.30.3conevolumePinareaPin","version":"0.20.14","type":"blockly"}} + script={{"script":"heightconevolumesurfaceArearoundedVolumeroundedSurfaceAreavolumeTextareaTextvolumePinareaPinheight5cone21height360000010volumeconesurfaceAreaconeroundedVolumevolume2roundedSurfaceAreasurfaceArea2volumeTextVolume {0} m3roundedVolumeareaTextArea {0} m3roundedSurfaceAreavolumePin0height01ADDheight301000volumeText0.30.3areaPin0height01ADDheight401000areaText0.30.3conevolumePinareaPin","version":"0.21.0","type":"blockly"}} title="Get volume and surface area from solid" /> {\n // Parametric height value\n const height = 5;\n\n // Create a cone\n const coneOptions = new ConeDto();\n coneOptions.radius1 = 2;\n coneOptions.radius2 = 1;\n coneOptions.height = height;\n coneOptions.angle = 360;\n coneOptions.center = [0, 0, 0] as Point3;\n coneOptions.direction = [0, 1, 0] as Vector3;\n\n const cone = await solid.createCone(coneOptions);\n\n // Get volume and surface area\n const volume = await solid.getSolidVolume({ shape: cone });\n const surfaceArea = await solid.getSolidSurfaceArea({ shape: cone });\n\n // Round to 2 decimal places\n const roundedVolume = math.roundToDecimals({ number: volume, decimalPlaces: 2 });\n const roundedSurfaceArea = math.roundToDecimals({ number: surfaceArea, decimalPlaces: 2 });\n\n // Format as text with units\n const volumeText = text.format({\n text: \"Volume {0} m3\",\n values: [text.toString({ item: roundedVolume })]\n });\n const areaText = text.format({\n text: \"Area {0} m2\",\n values: [text.toString({ item: roundedSurfaceArea })]\n });\n\n // Create pin labels to display the measurements\n const volumePinOptions = new PinWithLabelDto();\n volumePinOptions.startPoint = [0, height, 0] as Point3;\n volumePinOptions.endPoint = [1, height + 3, 0] as Point3;\n volumePinOptions.direction = [1, 0, 0] as Vector3;\n volumePinOptions.offsetFromStart = 0;\n volumePinOptions.label = volumeText;\n volumePinOptions.labelOffset = 0.3;\n volumePinOptions.labelSize = 0.3;\n\n const volumePin = await dimensions.pinWithLabel(volumePinOptions);\n\n const areaPinOptions = new PinWithLabelDto();\n areaPinOptions.startPoint = [0, height, 0] as Point3;\n areaPinOptions.endPoint = [1, height + 4, 0] as Point3;\n areaPinOptions.direction = [1, 0, 0] as Vector3;\n areaPinOptions.offsetFromStart = 0;\n areaPinOptions.label = areaText;\n areaPinOptions.labelOffset = 0.3;\n areaPinOptions.labelSize = 0.3;\n\n const areaPin = await dimensions.pinWithLabel(areaPinOptions);\n\n // Draw the cone and labels\n bitbybit.draw.drawAnyAsync({ entity: cone });\n bitbybit.draw.drawAnyAsync({ entity: volumePin });\n bitbybit.draw.drawAnyAsync({ entity: areaPin });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs and types\nconst { ConeDto, PinWithLabelDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Get access to OCCT modules\nconst { solid } = bitbybit.occt.shapes;\nconst { dimensions } = bitbybit.occt;\nconst { math, text } = bitbybit;\n\n// Define the main function to demonstrate volume and surface area calculation\nconst start = async () => {\n // Parametric height value\n const height = 5;\n\n // Create a cone\n const coneOptions = new ConeDto();\n coneOptions.radius1 = 2;\n coneOptions.radius2 = 1;\n coneOptions.height = height;\n coneOptions.angle = 360;\n coneOptions.center = [0, 0, 0] as Point3;\n coneOptions.direction = [0, 1, 0] as Vector3;\n\n const cone = await solid.createCone(coneOptions);\n\n // Get volume and surface area\n const volume = await solid.getSolidVolume({ shape: cone });\n const surfaceArea = await solid.getSolidSurfaceArea({ shape: cone });\n\n // Round to 2 decimal places\n const roundedVolume = math.roundToDecimals({ number: volume, decimalPlaces: 2 });\n const roundedSurfaceArea = math.roundToDecimals({ number: surfaceArea, decimalPlaces: 2 });\n\n // Format as text with units\n const volumeText = text.format({\n text: \"Volume {0} m3\",\n values: [text.toString({ item: roundedVolume })]\n });\n const areaText = text.format({\n text: \"Area {0} m2\",\n values: [text.toString({ item: roundedSurfaceArea })]\n });\n\n // Create pin labels to display the measurements\n const volumePinOptions = new PinWithLabelDto();\n volumePinOptions.startPoint = [0, height, 0] as Point3;\n volumePinOptions.endPoint = [1, height + 3, 0] as Point3;\n volumePinOptions.direction = [1, 0, 0] as Vector3;\n volumePinOptions.offsetFromStart = 0;\n volumePinOptions.label = volumeText;\n volumePinOptions.labelOffset = 0.3;\n volumePinOptions.labelSize = 0.3;\n\n const volumePin = await dimensions.pinWithLabel(volumePinOptions);\n\n const areaPinOptions = new PinWithLabelDto();\n areaPinOptions.startPoint = [0, height, 0] as Point3;\n areaPinOptions.endPoint = [1, height + 4, 0] as Point3;\n areaPinOptions.direction = [1, 0, 0] as Vector3;\n areaPinOptions.offsetFromStart = 0;\n areaPinOptions.label = areaText;\n areaPinOptions.labelOffset = 0.3;\n areaPinOptions.labelSize = 0.3;\n\n const areaPin = await dimensions.pinWithLabel(areaPinOptions);\n\n // Draw the cone and labels\n bitbybit.draw.drawAnyAsync({ entity: cone });\n bitbybit.draw.drawAnyAsync({ entity: volumePin });\n bitbybit.draw.drawAnyAsync({ entity: areaPin });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Get volume and surface area from solid" /> diff --git a/docs/learn/code/common/occt/shapes/wire/wire-basic-primitives.md b/docs/learn/code/common/occt/shapes/wire/wire-basic-primitives.md index 6363967a..4404b6ad 100644 --- a/docs/learn/code/common/occt/shapes/wire/wire-basic-primitives.md +++ b/docs/learn/code/common/occt/shapes/wire/wire-basic-primitives.md @@ -33,21 +33,21 @@ This example demonstrates the creation of the most common primitive wire types: circleWiresquareWirengonWireparallelogramWirerectangleWireellipseWirecircleWire3000010squareWire3500010ngonWire-60001062parallelogramWire-1100010TRUE3230rectangleWire26900010ellipseWire120001014circleWiresquareWirengonWireparallelogramWirerectangleWireellipseWire","version":"0.20.14","type":"blockly"}} + script={{"script":"circleWiresquareWirengonWireparallelogramWirerectangleWireellipseWirecircleWire3000010squareWire3500010ngonWire-60001062parallelogramWire-1100010TRUE3230rectangleWire26900010ellipseWire120001014circleWiresquareWirengonWireparallelogramWirerectangleWireellipseWire","version":"0.21.0","type":"blockly"}} title="Creating basic wire primitives" /> {\n // Create a circle wire\n const circleOptions = new CircleDto();\n circleOptions.radius = 3;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circleWire = await wire.createCircleWire(circleOptions);\n\n // Create a square wire at a different position\n const squareOptions = new SquareDto();\n squareOptions.size = 3;\n squareOptions.center = [5, 0, 0] as Point3;\n squareOptions.direction = [0, 1, 0] as Vector3;\n\n const squareWire = await wire.createSquareWire(squareOptions);\n\n // Create an NGon wire (hexagon)\n const ngonOptions = new NGonWireDto();\n ngonOptions.center = [-6, 0, 0] as Point3;\n ngonOptions.direction = [0, 1, 0] as Vector3;\n ngonOptions.nrCorners = 6;\n ngonOptions.radius = 2;\n\n const ngonWire = await wire.createNGonWire(ngonOptions);\n\n // Create a parallelogram wire\n const parallelogramOptions = new ParallelogramDto();\n parallelogramOptions.center = [-11, 0, 0] as Point3;\n parallelogramOptions.direction = [0, 1, 0] as Vector3;\n parallelogramOptions.aroundCenter = true;\n parallelogramOptions.width = 3;\n parallelogramOptions.height = 2;\n parallelogramOptions.angle = 30;\n\n const parallelogramWire = await wire.createParallelogramWire(parallelogramOptions);\n\n // Create a rectangle wire\n const rectangleOptions = new RectangleDto();\n rectangleOptions.width = 2;\n rectangleOptions.length = 6;\n rectangleOptions.center = [9, 0, 0] as Point3;\n rectangleOptions.direction = [0, 1, 0] as Vector3;\n\n const rectangleWire = await wire.createRectangleWire(rectangleOptions);\n\n // Create an ellipse wire\n const ellipseOptions = new EllipseDto();\n ellipseOptions.center = [12, 0, 0] as Point3;\n ellipseOptions.direction = [0, 1, 0] as Vector3;\n ellipseOptions.radiusMinor = 1;\n ellipseOptions.radiusMajor = 4;\n\n const ellipseWire = await wire.createEllipseWire(ellipseOptions);\n\n // Draw all the created wires\n bitbybit.draw.drawAnyAsync({ entity: circleWire });\n bitbybit.draw.drawAnyAsync({ entity: squareWire });\n bitbybit.draw.drawAnyAsync({ entity: ngonWire });\n bitbybit.draw.drawAnyAsync({ entity: parallelogramWire });\n bitbybit.draw.drawAnyAsync({ entity: rectangleWire });\n bitbybit.draw.drawAnyAsync({ entity: ellipseWire });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs and types for wire creation\nconst { CircleDto, SquareDto, NGonWireDto, ParallelogramDto, RectangleDto, EllipseDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Get access to OCCT wire creation functions\nconst { wire } = bitbybit.occt.shapes;\n\n// Define the main function to create various primitive wires\nconst start = async () => {\n // Create a circle wire\n const circleOptions = new CircleDto();\n circleOptions.radius = 3;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circleWire = await wire.createCircleWire(circleOptions);\n\n // Create a square wire at a different position\n const squareOptions = new SquareDto();\n squareOptions.size = 3;\n squareOptions.center = [5, 0, 0] as Point3;\n squareOptions.direction = [0, 1, 0] as Vector3;\n\n const squareWire = await wire.createSquareWire(squareOptions);\n\n // Create an NGon wire (hexagon)\n const ngonOptions = new NGonWireDto();\n ngonOptions.center = [-6, 0, 0] as Point3;\n ngonOptions.direction = [0, 1, 0] as Vector3;\n ngonOptions.nrCorners = 6;\n ngonOptions.radius = 2;\n\n const ngonWire = await wire.createNGonWire(ngonOptions);\n\n // Create a parallelogram wire\n const parallelogramOptions = new ParallelogramDto();\n parallelogramOptions.center = [-11, 0, 0] as Point3;\n parallelogramOptions.direction = [0, 1, 0] as Vector3;\n parallelogramOptions.aroundCenter = true;\n parallelogramOptions.width = 3;\n parallelogramOptions.height = 2;\n parallelogramOptions.angle = 30;\n\n const parallelogramWire = await wire.createParallelogramWire(parallelogramOptions);\n\n // Create a rectangle wire\n const rectangleOptions = new RectangleDto();\n rectangleOptions.width = 2;\n rectangleOptions.length = 6;\n rectangleOptions.center = [9, 0, 0] as Point3;\n rectangleOptions.direction = [0, 1, 0] as Vector3;\n\n const rectangleWire = await wire.createRectangleWire(rectangleOptions);\n\n // Create an ellipse wire\n const ellipseOptions = new EllipseDto();\n ellipseOptions.center = [12, 0, 0] as Point3;\n ellipseOptions.direction = [0, 1, 0] as Vector3;\n ellipseOptions.radiusMinor = 1;\n ellipseOptions.radiusMajor = 4;\n\n const ellipseWire = await wire.createEllipseWire(ellipseOptions);\n\n // Draw all the created wires\n bitbybit.draw.drawAnyAsync({ entity: circleWire });\n bitbybit.draw.drawAnyAsync({ entity: squareWire });\n bitbybit.draw.drawAnyAsync({ entity: ngonWire });\n bitbybit.draw.drawAnyAsync({ entity: parallelogramWire });\n bitbybit.draw.drawAnyAsync({ entity: rectangleWire });\n bitbybit.draw.drawAnyAsync({ entity: ellipseWire });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Creating basic wire primitives" /> diff --git a/docs/learn/code/common/occt/shapes/wire/wire-bezier-weights.md b/docs/learn/code/common/occt/shapes/wire/wire-bezier-weights.md index f3b33834..b4875453 100644 --- a/docs/learn/code/common/occt/shapes/wire/wire-bezier-weights.md +++ b/docs/learn/code/common/occt/shapes/wire/wire-bezier-weights.md @@ -34,21 +34,21 @@ This technique is invaluable for design work where you need the curve to emphasi point1point2point3point4point5pointsListweightsbezierWirepolylineRefminWeightmaxWeightspheressphere1sphere2sphere3sphere4sphere5point1-1000point2-503point307-5point4503point51000pointsListpoint1point2point3point4point5weights10602003010bezierWirepointsListweightsFALSEbezierWire0.01FALSETRUE#e4ff1a10polylineRefpointsListFALSEpolylineRefminWeightweightsmaxWeightweightssphere1point110minWeightmaxWeight0.30.9sphere2point260minWeightmaxWeight0.30.9sphere3point3200minWeightmaxWeight0.30.9sphere4point430minWeightmaxWeight0.30.9sphere5point510minWeightmaxWeight0.30.9spheressphere1sphere2sphere3sphere4sphere5spheres0.05TRUEFALSE#37ff00","version":"0.20.14","type":"blockly"}} + script={{"script":"point1point2point3point4point5pointsListweightsbezierWirepolylineRefminWeightmaxWeightspheressphere1sphere2sphere3sphere4sphere5point1-1000point2-503point307-5point4503point51000pointsListpoint1point2point3point4point5weights10602003010bezierWirepointsListweightsFALSEbezierWire0.01FALSETRUE#e4ff1a10polylineRefpointsListFALSEpolylineRefminWeightweightsmaxWeightweightssphere1point110minWeightmaxWeight0.30.9sphere2point260minWeightmaxWeight0.30.9sphere3point3200minWeightmaxWeight0.30.9sphere4point430minWeightmaxWeight0.30.9sphere5point510minWeightmaxWeight0.30.9spheressphere1sphere2sphere3sphere4sphere5spheres0.05TRUEFALSE#37ff00","version":"0.21.0","type":"blockly"}} title="Bezier curves with different weight distributions" /> {\n // Define control points for the Bezier curve\n const controlPoints: Point3[] = [\n [-10, 0, 0],\n [-5, 0, 3],\n [0, 7, -5],\n [5, 0, 3],\n [10, 0, 0]\n ];\n\n // Weight values - higher weights pull the curve closer to that point\n const weights: number[] = [10, 60, 200, 30, 10];\n \n // Create weighted Bezier curve\n const bezierOptions = new BezierWeightsDto();\n bezierOptions.points = controlPoints;\n bezierOptions.weights = weights;\n bezierOptions.closed = false;\n const bezierWire = await wire.createBezierWeights(bezierOptions);\n\n // Draw the Bezier curve with thick yellow line\n const wireDrawOptions = new DrawOcctShapeSimpleOptions();\n wireDrawOptions.precision = 0.01;\n wireDrawOptions.drawFaces = false;\n wireDrawOptions.drawEdges = true;\n wireDrawOptions.edgeColour = \"#e4ff1a\";\n wireDrawOptions.edgeWidth = 10;\n\n await draw.drawAnyAsync({ entity: bezierWire, options: wireDrawOptions });\n\n // Draw reference polyline connecting control points\n const plnOptions = new PolylineCreateDto();\n plnOptions.points = controlPoints;\n const pln = polyline.create(plnOptions) as Bit.Inputs.Draw.Entity;\n await draw.drawAnyAsync({ entity: pln });\n\n // Calculate weight range for sphere scaling\n const minWeight = vector.min({ vector: weights });\n const maxWeight = vector.max({ vector: weights });\n\n // Create spheres at control points, sized by their weights\n const spherePromises = [];\n for (let i = 0; i < controlPoints.length; i++) {\n // Remap weight to sphere radius (0.3 to 0.9)\n const remapOptions = new RemapNumberDto();\n remapOptions.number = weights[i];\n remapOptions.fromLow = minWeight;\n remapOptions.fromHigh = maxWeight;\n remapOptions.toLow = 0.3;\n remapOptions.toHigh = 0.9;\n\n const sphereOptions = new SphereDto();\n sphereOptions.center = controlPoints[i];\n sphereOptions.radius = bitbybit.math.remap(remapOptions);\n\n spherePromises.push(shapes.solid.createSphere(sphereOptions));\n }\n\n const spheres = await Promise.all(spherePromises);\n\n // Draw spheres in green\n const sphereDrawOptions = new DrawOcctShapeSimpleOptions();\n sphereDrawOptions.precision = 0.05;\n sphereDrawOptions.drawFaces = true;\n sphereDrawOptions.drawEdges = false;\n sphereDrawOptions.faceColour = \"#37ff00\";\n \n draw.drawAnyAsync({ entity: spheres, options: sphereDrawOptions });\n};\n\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs and types\nconst { BezierWeightsDto, SphereDto } = Bit.Inputs.OCCT;\nconst { DrawOcctShapeSimpleOptions } = Bit.Inputs.Draw;\nconst { RemapNumberDto } = Bit.Inputs.Math;\nconst { PolylineCreateDto } = Bit.Inputs.Polyline;\n\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer;\n\n// Get access to BitByBit functions\nconst { wire } = bitbybit.occt.shapes;\nconst { shapes } = bitbybit.occt;\nconst { draw, vector, polyline } = bitbybit;\n\nconst start = async () => {\n // Define control points for the Bezier curve\n const controlPoints: Point3[] = [\n [-10, 0, 0],\n [-5, 0, 3],\n [0, 7, -5],\n [5, 0, 3],\n [10, 0, 0]\n ];\n\n // Weight values - higher weights pull the curve closer to that point\n const weights: number[] = [10, 60, 200, 30, 10];\n \n // Create weighted Bezier curve\n const bezierOptions = new BezierWeightsDto();\n bezierOptions.points = controlPoints;\n bezierOptions.weights = weights;\n bezierOptions.closed = false;\n const bezierWire = await wire.createBezierWeights(bezierOptions);\n\n // Draw the Bezier curve with thick yellow line\n const wireDrawOptions = new DrawOcctShapeSimpleOptions();\n wireDrawOptions.precision = 0.01;\n wireDrawOptions.drawFaces = false;\n wireDrawOptions.drawEdges = true;\n wireDrawOptions.edgeColour = \"#e4ff1a\";\n wireDrawOptions.edgeWidth = 10;\n\n await draw.drawAnyAsync({ entity: bezierWire, options: wireDrawOptions });\n\n // Draw reference polyline connecting control points\n const plnOptions = new PolylineCreateDto();\n plnOptions.points = controlPoints;\n const pln = polyline.create(plnOptions) as Bit.Inputs.Draw.Entity;\n await draw.drawAnyAsync({ entity: pln });\n\n // Calculate weight range for sphere scaling\n const minWeight = vector.min({ vector: weights });\n const maxWeight = vector.max({ vector: weights });\n\n // Create spheres at control points, sized by their weights\n const spherePromises = [];\n for (let i = 0; i < controlPoints.length; i++) {\n // Remap weight to sphere radius (0.3 to 0.9)\n const remapOptions = new RemapNumberDto();\n remapOptions.number = weights[i];\n remapOptions.fromLow = minWeight;\n remapOptions.fromHigh = maxWeight;\n remapOptions.toLow = 0.3;\n remapOptions.toHigh = 0.9;\n\n const sphereOptions = new SphereDto();\n sphereOptions.center = controlPoints[i];\n sphereOptions.radius = bitbybit.math.remap(remapOptions);\n\n spherePromises.push(shapes.solid.createSphere(sphereOptions));\n }\n\n const spheres = await Promise.all(spherePromises);\n\n // Draw spheres in green\n const sphereDrawOptions = new DrawOcctShapeSimpleOptions();\n sphereDrawOptions.precision = 0.05;\n sphereDrawOptions.drawFaces = true;\n sphereDrawOptions.drawEdges = false;\n sphereDrawOptions.faceColour = \"#37ff00\";\n \n draw.drawAnyAsync({ entity: spheres, options: sphereDrawOptions });\n};\n\nstart();","version":"0.21.0","type":"typescript"}} title="Bezier curves with different weight distributions" /> diff --git a/docs/learn/code/common/occt/shapes/wire/wire-from-edges.md b/docs/learn/code/common/occt/shapes/wire/wire-from-edges.md index 2d47da58..60c1ce6a 100644 --- a/docs/learn/code/common/occt/shapes/wire/wire-from-edges.md +++ b/docs/learn/code/common/occt/shapes/wire/wire-from-edges.md @@ -60,21 +60,21 @@ This example showcases how simple geometric operations (arc creation and rotatio arc1arc2arc3arc4edgesListcombinedWirearc1505003-505arc2arc101090arc3arc201090arc4arc301090edgesListarc1arc2arc3arc4combinedWireedgesListcombinedWire","version":"0.20.14","type":"blockly"}} + script={{"script":"arc1arc2arc3arc4edgesListcombinedWirearc1505003-505arc2arc101090arc3arc201090arc4arc301090edgesListarc1arc2arc3arc4combinedWireedgesListcombinedWire","version":"0.21.0","type":"blockly"}} title="Combining edges into a wire" /> {\n // Create the first arc through three points\n const arcOptions = new ArcEdgeThreePointsDto();\n arcOptions.start = [5, 0, 5] as Point3;\n arcOptions.middle = [0, 0, 3] as Point3;\n arcOptions.end = [-5, 0, 5] as Point3;\n\n const arc1 = await edge.arcThroughThreePoints(arcOptions);\n\n // Create rotation options for Y-axis rotation\n const rotateOptions = new RotateDto();\n rotateOptions.axis = [0, 1, 0] as Vector3;\n rotateOptions.angle = 90; // 90 degrees\n\n // Create three more arcs by rotating the first arc\n rotateOptions.shape = arc1;\n const arc2 = await transforms.rotate(rotateOptions);\n\n rotateOptions.shape = arc2;\n const arc3 = await transforms.rotate(rotateOptions);\n\n rotateOptions.shape = arc3;\n const arc4 = await transforms.rotate(rotateOptions);\n\n // Combine all arc edges into a single wire\n const combineOptions = new ShapesDto();\n combineOptions.shapes = [arc1, arc2, arc3, arc4];\n\n const combinedWire = await wire.combineEdgesAndWiresIntoAWire(combineOptions);\n\n // Draw the combined wire\n bitbybit.draw.drawAnyAsync({ entity: combinedWire });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs and types for edge and wire creation\nconst { ArcEdgeThreePointsDto, RotateDto, ShapesDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer;\ntype TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;\n\n// Get access to OCCT edge, wire, and transform functions\nconst { edge, wire } = bitbybit.occt.shapes;\nconst { transforms } = bitbybit.occt;\n\n// Define the main function to create a wire from multiple edges\nconst start = async () => {\n // Create the first arc through three points\n const arcOptions = new ArcEdgeThreePointsDto();\n arcOptions.start = [5, 0, 5] as Point3;\n arcOptions.middle = [0, 0, 3] as Point3;\n arcOptions.end = [-5, 0, 5] as Point3;\n\n const arc1 = await edge.arcThroughThreePoints(arcOptions);\n\n // Create rotation options for Y-axis rotation\n const rotateOptions = new RotateDto();\n rotateOptions.axis = [0, 1, 0] as Vector3;\n rotateOptions.angle = 90; // 90 degrees\n\n // Create three more arcs by rotating the first arc\n rotateOptions.shape = arc1;\n const arc2 = await transforms.rotate(rotateOptions);\n\n rotateOptions.shape = arc2;\n const arc3 = await transforms.rotate(rotateOptions);\n\n rotateOptions.shape = arc3;\n const arc4 = await transforms.rotate(rotateOptions);\n\n // Combine all arc edges into a single wire\n const combineOptions = new ShapesDto();\n combineOptions.shapes = [arc1, arc2, arc3, arc4];\n\n const combinedWire = await wire.combineEdgesAndWiresIntoAWire(combineOptions);\n\n // Draw the combined wire\n bitbybit.draw.drawAnyAsync({ entity: combinedWire });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Combining edges into a wire" /> diff --git a/docs/learn/code/common/occt/shapes/wire/wire-hexagons-advanced-pattern.md b/docs/learn/code/common/occt/shapes/wire/wire-hexagons-advanced-pattern.md index 1c9d8473..5a0e78e6 100644 --- a/docs/learn/code/common/occt/shapes/wire/wire-hexagons-advanced-pattern.md +++ b/docs/learn/code/common/occt/shapes/wire/wire-hexagons-advanced-pattern.md @@ -35,21 +35,21 @@ This approach demonstrates the power of parametric design thinking, where simple gridWidthgridHeighthexagonsInWidthhexagonsInHeightcontrolPointXcontrolPointZcontrolPointhexGridhexCentersdistancesminDistancemaxDistancescalePatternidistancescaledValueinclusionPatternhexagonWiresboundaryWiregridWidth16.5gridHeight9hexagonsInWidth20hexagonsInHeight20controlPointX2.2controlPointZ2.8controlPointcontrolPointX0controlPointZhexGridgridWidthgridHeighthexagonsInWidthhexagonsInHeightTRUEFALSEFALSEFALSEFALSETRUETRUEhexCentershexGridcentersdistancescontrolPointhexCentersminDistancedistancesmaxDistancedistancesscalePatterndistancedistancesscaledValuedistanceminDistancemaxDistance0.1110.999INSERTLASTscalePatternscaledValueinclusionPattern[true, true, false]hexagonWiresgridWidthgridHeighthexagonsInWidthhexagonsInHeightTRUEFALSEFALSEFALSEFALSEscalePatternscalePatterninclusionPatternboundaryWiregridWidthgridHeight000010hexagonWiresboundaryWirecontrolPoint","version":"0.20.14","type":"blockly"}} + script={{"script":"gridWidthgridHeighthexagonsInWidthhexagonsInHeightcontrolPointXcontrolPointZcontrolPointhexGridhexCentersdistancesminDistancemaxDistancescalePatternidistancescaledValueinclusionPatternhexagonWiresboundaryWiregridWidth16.5gridHeight9hexagonsInWidth20hexagonsInHeight20controlPointX2.2controlPointZ2.8controlPointcontrolPointX0controlPointZhexGridgridWidthgridHeighthexagonsInWidthhexagonsInHeightTRUEFALSEFALSEFALSEFALSETRUETRUEhexCentershexGridcentersdistancescontrolPointhexCentersminDistancedistancesmaxDistancedistancesscalePatterndistancedistancesscaledValuedistanceminDistancemaxDistance0.1110.999INSERTLASTscalePatternscaledValueinclusionPattern[true, true, false]hexagonWiresgridWidthgridHeighthexagonsInWidthhexagonsInHeightTRUEFALSEFALSEFALSEFALSEscalePatternscalePatterninclusionPatternboundaryWiregridWidthgridHeight000010hexagonWiresboundaryWirecontrolPoint","version":"0.21.0","type":"blockly"}} title="Creating hexagon grids in beautiful patterns" /> {\n // Define grid dimensions\n const gridWidth = 16.5;\n const gridHeight = 9;\n const hexagonsInWidth = 20;\n const hexagonsInHeight = 20;\n\n // Control point for distance calculation\n const controlPointX = 2.2;\n const controlPointZ = 2.8;\n const controlPoint: Point3 = [controlPointX, 0, controlPointZ];\n\n // Generate hex grid to get center points\n const hexGridOptions = new HexGridScaledToFitDto();\n hexGridOptions.width = gridWidth;\n hexGridOptions.height = gridHeight;\n hexGridOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridOptions.flatTop = true;\n hexGridOptions.extendTop = false;\n hexGridOptions.extendBottom = false;\n hexGridOptions.extendLeft = false;\n hexGridOptions.extendRight = false;\n hexGridOptions.centerGrid = true;\n hexGridOptions.pointsOnGround = true;\n\n const hexGrid: HexGridData = bitbybit.point.hexGridScaledToFit(hexGridOptions);\n const hexCenters = hexGrid.centers;\n\n // Calculate distances from control point to all hex centers\n const distanceOptions = new StartEndPointsListDto();\n distanceOptions.startPoint = controlPoint;\n distanceOptions.endPoints = hexCenters;\n\n const distances = bitbybit.point.distancesToPoints(distanceOptions);\n\n // Find min and max distances for remapping\n const minDistance = bitbybit.vector.min({ vector: distances });\n const maxDistance = bitbybit.vector.max({ vector: distances });\n\n // Remap distances to scale values between 0.111 and 0.999\n const scalePattern: number[] = [];\n\n for (const distance of distances) {\n const remapOptions = new RemapNumberDto();\n remapOptions.number = distance;\n remapOptions.fromLow = minDistance;\n remapOptions.fromHigh = maxDistance;\n remapOptions.toLow = 0.111;\n remapOptions.toHigh = 0.999;\n\n const scaledValue = bitbybit.math.remap(remapOptions);\n scalePattern.push(scaledValue);\n }\n\n // Create hexagonal grid with patterns\n const hexGridPatternOptions = new HexagonsInGridDto();\n hexGridPatternOptions.width = gridWidth;\n hexGridPatternOptions.height = gridHeight;\n hexGridPatternOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridPatternOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridPatternOptions.flatTop = true;\n hexGridPatternOptions.extendTop = false;\n hexGridPatternOptions.extendBottom = false;\n hexGridPatternOptions.extendLeft = false;\n hexGridPatternOptions.extendRight = false;\n\n // Apply the distance-based scale pattern to both width and height\n hexGridPatternOptions.scalePatternWidth = scalePattern;\n hexGridPatternOptions.scalePatternHeight = scalePattern;\n\n // Apply inclusion pattern to selectively remove some hexagons\n const inclusionPattern = [true, true, false]; // Pattern repeats across the grid\n hexGridPatternOptions.inclusionPattern = inclusionPattern;\n\n // Generate the patterned hexagon grid\n const hexagonWires = await bitbybit.occt.shapes.wire.hexagonsInGrid(hexGridPatternOptions);\n\n // Create a boundary rectangle for reference\n const boundaryOptions = new RectangleDto();\n boundaryOptions.width = gridWidth;\n boundaryOptions.length = gridHeight;\n boundaryOptions.center = [0, 0, 0] as Point3;\n boundaryOptions.direction = [0, 1, 0] as Vector3;\n\n const boundaryWire = await bitbybit.occt.shapes.wire.createRectangleWire(boundaryOptions);\n\n // Draw the patterned hexagon grid and boundary\n bitbybit.draw.drawAnyAsync({ entity: hexagonWires });\n bitbybit.draw.drawAnyAsync({ entity: boundaryWire });\n\n // Optionally draw the control point for reference\n bitbybit.draw.drawAnyAsync({ entity: controlPoint });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const { HexagonsInGridDto, RectangleDto } = Bit.Inputs.OCCT;\nconst { HexGridScaledToFitDto, StartEndPointsListDto } = Bit.Inputs.Point;\nconst { RemapNumberDto } = Bit.Inputs.Math;\n// Import required types\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype HexGridData = Bit.Models.Point.HexGridData;\n\n// Define the main function\nconst start = async () => {\n // Define grid dimensions\n const gridWidth = 16.5;\n const gridHeight = 9;\n const hexagonsInWidth = 20;\n const hexagonsInHeight = 20;\n\n // Control point for distance calculation\n const controlPointX = 2.2;\n const controlPointZ = 2.8;\n const controlPoint: Point3 = [controlPointX, 0, controlPointZ];\n\n // Generate hex grid to get center points\n const hexGridOptions = new HexGridScaledToFitDto();\n hexGridOptions.width = gridWidth;\n hexGridOptions.height = gridHeight;\n hexGridOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridOptions.flatTop = true;\n hexGridOptions.extendTop = false;\n hexGridOptions.extendBottom = false;\n hexGridOptions.extendLeft = false;\n hexGridOptions.extendRight = false;\n hexGridOptions.centerGrid = true;\n hexGridOptions.pointsOnGround = true;\n\n const hexGrid: HexGridData = bitbybit.point.hexGridScaledToFit(hexGridOptions);\n const hexCenters = hexGrid.centers;\n\n // Calculate distances from control point to all hex centers\n const distanceOptions = new StartEndPointsListDto();\n distanceOptions.startPoint = controlPoint;\n distanceOptions.endPoints = hexCenters;\n\n const distances = bitbybit.point.distancesToPoints(distanceOptions);\n\n // Find min and max distances for remapping\n const minDistance = bitbybit.vector.min({ vector: distances });\n const maxDistance = bitbybit.vector.max({ vector: distances });\n\n // Remap distances to scale values between 0.111 and 0.999\n const scalePattern: number[] = [];\n\n for (const distance of distances) {\n const remapOptions = new RemapNumberDto();\n remapOptions.number = distance;\n remapOptions.fromLow = minDistance;\n remapOptions.fromHigh = maxDistance;\n remapOptions.toLow = 0.111;\n remapOptions.toHigh = 0.999;\n\n const scaledValue = bitbybit.math.remap(remapOptions);\n scalePattern.push(scaledValue);\n }\n\n // Create hexagonal grid with patterns\n const hexGridPatternOptions = new HexagonsInGridDto();\n hexGridPatternOptions.width = gridWidth;\n hexGridPatternOptions.height = gridHeight;\n hexGridPatternOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridPatternOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridPatternOptions.flatTop = true;\n hexGridPatternOptions.extendTop = false;\n hexGridPatternOptions.extendBottom = false;\n hexGridPatternOptions.extendLeft = false;\n hexGridPatternOptions.extendRight = false;\n\n // Apply the distance-based scale pattern to both width and height\n hexGridPatternOptions.scalePatternWidth = scalePattern;\n hexGridPatternOptions.scalePatternHeight = scalePattern;\n\n // Apply inclusion pattern to selectively remove some hexagons\n const inclusionPattern = [true, true, false]; // Pattern repeats across the grid\n hexGridPatternOptions.inclusionPattern = inclusionPattern;\n\n // Generate the patterned hexagon grid\n const hexagonWires = await bitbybit.occt.shapes.wire.hexagonsInGrid(hexGridPatternOptions);\n\n // Create a boundary rectangle for reference\n const boundaryOptions = new RectangleDto();\n boundaryOptions.width = gridWidth;\n boundaryOptions.length = gridHeight;\n boundaryOptions.center = [0, 0, 0] as Point3;\n boundaryOptions.direction = [0, 1, 0] as Vector3;\n\n const boundaryWire = await bitbybit.occt.shapes.wire.createRectangleWire(boundaryOptions);\n\n // Draw the patterned hexagon grid and boundary\n bitbybit.draw.drawAnyAsync({ entity: hexagonWires });\n bitbybit.draw.drawAnyAsync({ entity: boundaryWire });\n\n // Optionally draw the control point for reference\n bitbybit.draw.drawAnyAsync({ entity: controlPoint });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Creating hexagon grids" /> diff --git a/docs/learn/code/common/occt/shapes/wire/wire-hexagons-in-grid.md b/docs/learn/code/common/occt/shapes/wire/wire-hexagons-in-grid.md index 3fb8c7e4..45688c92 100644 --- a/docs/learn/code/common/occt/shapes/wire/wire-hexagons-in-grid.md +++ b/docs/learn/code/common/occt/shapes/wire/wire-hexagons-in-grid.md @@ -50,21 +50,21 @@ The component also includes advanced patterning capabilities through optional ar widthheightwidth16.5height9widthheight2318FALSEFALSEFALSEFALSEFALSEwidthheight000010","version":"0.20.14","type":"blockly"}} + script={{"script":"widthheightwidth16.5height9widthheight2318FALSEFALSEFALSEFALSEFALSEwidthheight000010","version":"0.21.0","type":"blockly"}} title="Creating hexagon grids" /> {\n // Define grid dimensions\n const gridWidth = 16.5;\n const gridHeight = 9;\n const hexagonsInWidth = 23;\n const hexagonsInHeight = 18;\n\n // Create hexagonal grid parameters\n const hexGridOptions = new HexagonsInGridDto();\n hexGridOptions.width = gridWidth;\n hexGridOptions.height = gridHeight;\n hexGridOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridOptions.flatTop = false; // Pointed-top hexagons\n hexGridOptions.extendTop = false;\n hexGridOptions.extendBottom = false;\n hexGridOptions.extendLeft = false;\n hexGridOptions.extendRight = false;\n\n // Generate the hexagon grid\n const hexagonWires = await bitbybit.occt.shapes.wire.hexagonsInGrid(hexGridOptions);\n\n // Create a boundary rectangle for reference\n const boundaryOptions = new RectangleDto();\n boundaryOptions.width = gridWidth;\n boundaryOptions.length = gridHeight;\n boundaryOptions.center = [0, 0, 0] as Point3;\n boundaryOptions.direction = [0, 1, 0] as Vector3;\n\n const boundaryWire = await bitbybit.occt.shapes.wire.createRectangleWire(boundaryOptions);\n\n // Draw the hexagon grid and boundary\n bitbybit.draw.drawAnyAsync({ entity: hexagonWires });\n bitbybit.draw.drawAnyAsync({ entity: boundaryWire });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"const { HexagonsInGridDto, RectangleDto } = Bit.Inputs.OCCT;\n// Import required types\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Define the main function\nconst start = async () => {\n // Define grid dimensions\n const gridWidth = 16.5;\n const gridHeight = 9;\n const hexagonsInWidth = 23;\n const hexagonsInHeight = 18;\n\n // Create hexagonal grid parameters\n const hexGridOptions = new HexagonsInGridDto();\n hexGridOptions.width = gridWidth;\n hexGridOptions.height = gridHeight;\n hexGridOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridOptions.flatTop = false; // Pointed-top hexagons\n hexGridOptions.extendTop = false;\n hexGridOptions.extendBottom = false;\n hexGridOptions.extendLeft = false;\n hexGridOptions.extendRight = false;\n\n // Generate the hexagon grid\n const hexagonWires = await bitbybit.occt.shapes.wire.hexagonsInGrid(hexGridOptions);\n\n // Create a boundary rectangle for reference\n const boundaryOptions = new RectangleDto();\n boundaryOptions.width = gridWidth;\n boundaryOptions.length = gridHeight;\n boundaryOptions.center = [0, 0, 0] as Point3;\n boundaryOptions.direction = [0, 1, 0] as Vector3;\n\n const boundaryWire = await bitbybit.occt.shapes.wire.createRectangleWire(boundaryOptions);\n\n // Draw the hexagon grid and boundary\n bitbybit.draw.drawAnyAsync({ entity: hexagonWires });\n bitbybit.draw.drawAnyAsync({ entity: boundaryWire });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Creating hexagon grids" /> diff --git a/docs/learn/code/common/occt/shapes/wire/wire-shape-primitives.md b/docs/learn/code/common/occt/shapes/wire/wire-shape-primitives.md index 18192ed2..86a92a6f 100644 --- a/docs/learn/code/common/occt/shapes/wire/wire-shape-primitives.md +++ b/docs/learn/code/common/occt/shapes/wire/wire-shape-primitives.md @@ -50,21 +50,21 @@ The star wire creates beautiful star-shaped patterns with customizable rays, rad starWirestarWire000010107.83.70FALSEstarWire","version":"0.20.14","type":"blockly"}} + script={{"script":"starWirestarWire000010107.83.70FALSEstarWire","version":"0.21.0","type":"blockly"}} title="Creating basic wire star primitive" /> {\n // Create a star wire with customizable parameters\n const starOptions = new StarDto();\n starOptions.center = [0, 0, 0] as Point3;\n starOptions.direction = [0, 1, 0] as Vector3;\n starOptions.numRays = 10;\n starOptions.outerRadius = 7.8;\n starOptions.innerRadius = 3.7;\n starOptions.offsetOuterEdges = 0;\n starOptions.half = false;\n\n const starWire = await wire.createStarWire(starOptions);\n\n // Draw the created star wire\n bitbybit.draw.drawAnyAsync({ entity: starWire });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs and types for star wire creation\nconst { StarDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Get access to OCCT wire creation functions\nconst { wire } = bitbybit.occt.shapes;\n\n// Define the main function to create a star wire\nconst start = async () => {\n // Create a star wire with customizable parameters\n const starOptions = new StarDto();\n starOptions.center = [0, 0, 0] as Point3;\n starOptions.direction = [0, 1, 0] as Vector3;\n starOptions.numRays = 10;\n starOptions.outerRadius = 7.8;\n starOptions.innerRadius = 3.7;\n starOptions.offsetOuterEdges = 0;\n starOptions.half = false;\n\n const starWire = await wire.createStarWire(starOptions);\n\n // Draw the created star wire\n bitbybit.draw.drawAnyAsync({ entity: starWire });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Creating basic wire star primitive" /> @@ -86,21 +86,21 @@ The Christmas tree wire creates detailed tree-like structures perfect for season christmasTreeWirechristmasTreeWire61.53511FALSE0000010christmasTreeWire","version":"0.20.14","type":"blockly"}} + script={{"script":"christmasTreeWirechristmasTreeWire61.53511FALSE0000010christmasTreeWire","version":"0.21.0","type":"blockly"}} title="Creating basic wire primitive of christmass tree" /> {\n // Create a Christmas tree wire with customizable parameters\n const treeOptions = new ChristmasTreeDto();\n treeOptions.height = 6;\n treeOptions.innerDist = 1.5;\n treeOptions.outerDist = 3;\n treeOptions.nrSkirts = 5;\n treeOptions.trunkHeight = 1;\n treeOptions.trunkWidth = 1;\n treeOptions.half = false;\n treeOptions.rotation = 0;\n treeOptions.origin = [0, 0, 0] as Point3;\n treeOptions.direction = [0, 1, 0] as Vector3;\n\n const christmasTreeWire = await wire.createChristmasTreeWire(treeOptions);\n\n // Draw the created Christmas tree wire\n bitbybit.draw.drawAnyAsync({ entity: christmasTreeWire });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs and types for Christmas tree wire creation\nconst { ChristmasTreeDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Get access to OCCT wire creation functions\nconst { wire } = bitbybit.occt.shapes;\n\n// Define the main function to create a Christmas tree wire\nconst start = async () => {\n // Create a Christmas tree wire with customizable parameters\n const treeOptions = new ChristmasTreeDto();\n treeOptions.height = 6;\n treeOptions.innerDist = 1.5;\n treeOptions.outerDist = 3;\n treeOptions.nrSkirts = 5;\n treeOptions.trunkHeight = 1;\n treeOptions.trunkWidth = 1;\n treeOptions.half = false;\n treeOptions.rotation = 0;\n treeOptions.origin = [0, 0, 0] as Point3;\n treeOptions.direction = [0, 1, 0] as Vector3;\n\n const christmasTreeWire = await wire.createChristmasTreeWire(treeOptions);\n\n // Draw the created Christmas tree wire\n bitbybit.draw.drawAnyAsync({ entity: christmasTreeWire });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Creating basic wire primitive of christmass tree" /> @@ -122,21 +122,21 @@ The heart wire creates elegant heart-shaped curves, perfect for decorative appli heartWireheartWire00001008heartWire","version":"0.20.14","type":"blockly"}} + script={{"script":"heartWireheartWire00001008heartWire","version":"0.21.0","type":"blockly"}} title="Creating basic wire primitive of heart" /> {\n // Create a heart wire with customizable parameters\n const heartOptions = new Heart2DDto();\n heartOptions.center = [0, 0, 0] as Point3;\n heartOptions.direction = [0, 1, 0] as Vector3;\n heartOptions.rotation = 0;\n heartOptions.sizeApprox = 8;\n\n const heartWire = await wire.createHeartWire(heartOptions);\n\n // Draw the created heart wire\n bitbybit.draw.drawAnyAsync({ entity: heartWire });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs and types for heart wire creation\nconst { Heart2DDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Get access to OCCT wire creation functions\nconst { wire } = bitbybit.occt.shapes;\n\n// Define the main function to create a heart wire\nconst start = async () => {\n // Create a heart wire with customizable parameters\n const heartOptions = new Heart2DDto();\n heartOptions.center = [0, 0, 0] as Point3;\n heartOptions.direction = [0, 1, 0] as Vector3;\n heartOptions.rotation = 0;\n heartOptions.sizeApprox = 8;\n\n const heartWire = await wire.createHeartWire(heartOptions);\n\n // Draw the created heart wire\n bitbybit.draw.drawAnyAsync({ entity: heartWire });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Creating basic wire primitive of heart" /> @@ -156,21 +156,21 @@ The L-polygon wire creates precise L-shaped structures essential for architectur lPolygonWirelPolygonWire3537'outside'0000010lPolygonWire","version":"0.20.14","type":"blockly"}} + script={{"script":"lPolygonWirelPolygonWire3537'outside'0000010lPolygonWire","version":"0.21.0","type":"blockly"}} title="Creating basic wire primitive of L polygon" /> {\n // Create an L polygon wire with customizable parameters\n const lPolygonOptions = new LPolygonDto();\n lPolygonOptions.widthFirst = 3;\n lPolygonOptions.lengthFirst = 5;\n lPolygonOptions.widthSecond = 3;\n lPolygonOptions.lengthSecond = 7;\n lPolygonOptions.align = directionEnum.outside;\n lPolygonOptions.rotation = 0;\n lPolygonOptions.center = [0, 0, 0] as Point3;\n lPolygonOptions.direction = [0, 1, 0] as Vector3;\n\n const lPolygonWire = await wire.createLPolygonWire(lPolygonOptions);\n\n // Draw the created L polygon wire\n bitbybit.draw.drawAnyAsync({ entity: lPolygonWire });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs and types for L polygon wire creation\nconst { LPolygonDto, directionEnum } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Get access to OCCT wire creation functions\nconst { wire } = bitbybit.occt.shapes;\n\n// Define the main function to create an L polygon wire\nconst start = async () => {\n // Create an L polygon wire with customizable parameters\n const lPolygonOptions = new LPolygonDto();\n lPolygonOptions.widthFirst = 3;\n lPolygonOptions.lengthFirst = 5;\n lPolygonOptions.widthSecond = 3;\n lPolygonOptions.lengthSecond = 7;\n lPolygonOptions.align = directionEnum.outside;\n lPolygonOptions.rotation = 0;\n lPolygonOptions.center = [0, 0, 0] as Point3;\n lPolygonOptions.direction = [0, 1, 0] as Vector3;\n\n const lPolygonWire = await wire.createLPolygonWire(lPolygonOptions);\n\n // Draw the created L polygon wire\n bitbybit.draw.drawAnyAsync({ entity: lPolygonWire });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Creating basic wire primitive of L polygon" /> diff --git a/docs/learn/code/common/occt/shapes/wire/wire-via-points.md b/docs/learn/code/common/occt/shapes/wire/wire-via-points.md index dfa37262..da02562f 100644 --- a/docs/learn/code/common/occt/shapes/wire/wire-via-points.md +++ b/docs/learn/code/common/occt/shapes/wire/wire-via-points.md @@ -75,21 +75,21 @@ This example demonstrates all major methods for creating wires from points, show point1point2point3point4point5pointsListlineWirepolylineWirepolygonWireinterpolatedWireinterpolatedPeriodicWirebezierWirebsplineWirepoint1-400point2-201point300-1point4202point5400pointsListpoint1point2point3point4point5lineWirepoint1point5polylineWirepointsList010polygonWirepointsList020interpolatedWirepointsListFALSE1e-7030interpolatedPeriodicWirepointsListTRUE1e-7040bezierWirepointsList050bsplineWirepointsListFALSE3060lineWirepolylineWirepolygonWireinterpolatedWireinterpolatedPeriodicWirebezierWirebsplineWire","version":"0.20.14","type":"blockly"}} + script={{"script":"point1point2point3point4point5pointsListlineWirepolylineWirepolygonWireinterpolatedWireinterpolatedPeriodicWirebezierWirebsplineWirepoint1-400point2-201point300-1point4202point5400pointsListpoint1point2point3point4point5lineWirepoint1point5polylineWirepointsList010polygonWirepointsList020interpolatedWirepointsListFALSE1e-7030interpolatedPeriodicWirepointsListTRUE1e-7040bezierWirepointsList050bsplineWirepointsListFALSE3060lineWirepolylineWirepolygonWireinterpolatedWireinterpolatedPeriodicWirebezierWirebsplineWire","version":"0.21.0","type":"blockly"}} title="Comprehensive wire creation from points" /> {\n // Define a set of control points for wire creation\n const points: Point3[] = [\n [-4, 0, 0], // Start point\n [-2, 0, 1], // First control point\n [0, 0, -1], // Second control point\n [2, 0, 2], // Third control point\n [4, 0, 0] // End point\n ];\n\n // 1. Create a simple line wire between first and last points\n const lineOptions = new LineDto();\n lineOptions.start = points[0];\n lineOptions.end = points[4];\n const lineWire = await wire.createLineWire(lineOptions);\n\n // 2. Create a polyline wire connecting all points with straight segments\n const polylineOptions = new PolylineDto();\n polylineOptions.points = points;\n const polylineWire = await wire.createPolylineWire(polylineOptions);\n\n // 3. Create a polygon wire (closed shape) from the points\n const polygonOptions = new PolygonDto();\n polygonOptions.points = points;\n const polygonWire = await wire.createPolygonWire(polygonOptions);\n\n // 4. Create an interpolated wire that passes smoothly through all points\n const interpolationOptions = new InterpolationDto();\n interpolationOptions.points = points;\n interpolationOptions.periodic = false;\n interpolationOptions.tolerance = 1e-7;\n const interpolatedWire = await wire.interpolatePoints(interpolationOptions);\n\n // 5. Create an interpolated periodic wire that creates a closed smooth curve\n const interpolationPeriodicOptions = new InterpolationDto();\n interpolationPeriodicOptions.points = points;\n interpolationPeriodicOptions.periodic = true;\n interpolationPeriodicOptions.tolerance = 1e-7;\n const interpolatedPeriodicWire = await wire.interpolatePoints(interpolationPeriodicOptions);\n\n // 6. Create a Bezier curve using points as control points\n const bezierOptions = new BezierDto();\n bezierOptions.points = points;\n bezierOptions.closed = false;\n const bezierWire = await wire.createBezier(bezierOptions);\n\n // 7. Create a BSpline curve with specified degree\n const bsplineOptions = new BSplineDto();\n bsplineOptions.points = points;\n bsplineOptions.closed = false;\n const bsplineWire = await wire.createBSpline(bsplineOptions);\n\n // Translate wires to different Y positions for better visualization\n const translateOptions = new TranslateDto();\n\n // Translate polyline\n translateOptions.shape = polylineWire;\n translateOptions.translation = [0, 1, 0] as Vector3;\n const translatedPolyline = await transforms.translate(translateOptions);\n\n // Translate polygon\n translateOptions.shape = polygonWire;\n translateOptions.translation = [0, 2, 0] as Vector3;\n const translatedPolygon = await transforms.translate(translateOptions);\n\n // Translate interpolated wire\n translateOptions.shape = interpolatedWire;\n translateOptions.translation = [0, 3, 0] as Vector3;\n const translatedInterpolated = await transforms.translate(translateOptions);\n\n // Translate interpolated periodic wire\n translateOptions.shape = interpolatedPeriodicWire;\n translateOptions.translation = [0, 4, 0] as Vector3;\n const translatedInterpolatedPeriodic = await transforms.translate(translateOptions);\n\n // Translate Bezier wire\n translateOptions.shape = bezierWire;\n translateOptions.translation = [0, 5, 0] as Vector3;\n const translatedBezier = await transforms.translate(translateOptions);\n\n // Translate BSpline wire\n translateOptions.shape = bsplineWire;\n translateOptions.translation = [0, 6, 0] as Vector3;\n const translatedBSpline = await transforms.translate(translateOptions);\n\n // Draw all the created wires\n bitbybit.draw.drawAnyAsync({ entity: lineWire });\n bitbybit.draw.drawAnyAsync({ entity: translatedPolyline });\n bitbybit.draw.drawAnyAsync({ entity: translatedPolygon });\n bitbybit.draw.drawAnyAsync({ entity: translatedInterpolated });\n bitbybit.draw.drawAnyAsync({ entity: translatedInterpolatedPeriodic });\n bitbybit.draw.drawAnyAsync({ entity: translatedBezier });\n bitbybit.draw.drawAnyAsync({ entity: translatedBSpline });\n}\n\n// Execute the function\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Import required DTOs and types for wire creation\nconst { LineDto, PolylineDto, PolygonDto, InterpolationDto, BezierDto, BSplineDto, TranslateDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer;\n\n// Get access to OCCT wire creation and transform functions\nconst { wire } = bitbybit.occt.shapes;\nconst { transforms } = bitbybit.occt;\n\n// Define the main function to demonstrate various wire creation methods\nconst start = async () => {\n // Define a set of control points for wire creation\n const points: Point3[] = [\n [-4, 0, 0], // Start point\n [-2, 0, 1], // First control point\n [0, 0, -1], // Second control point\n [2, 0, 2], // Third control point\n [4, 0, 0] // End point\n ];\n\n // 1. Create a simple line wire between first and last points\n const lineOptions = new LineDto();\n lineOptions.start = points[0];\n lineOptions.end = points[4];\n const lineWire = await wire.createLineWire(lineOptions);\n\n // 2. Create a polyline wire connecting all points with straight segments\n const polylineOptions = new PolylineDto();\n polylineOptions.points = points;\n const polylineWire = await wire.createPolylineWire(polylineOptions);\n\n // 3. Create a polygon wire (closed shape) from the points\n const polygonOptions = new PolygonDto();\n polygonOptions.points = points;\n const polygonWire = await wire.createPolygonWire(polygonOptions);\n\n // 4. Create an interpolated wire that passes smoothly through all points\n const interpolationOptions = new InterpolationDto();\n interpolationOptions.points = points;\n interpolationOptions.periodic = false;\n interpolationOptions.tolerance = 1e-7;\n const interpolatedWire = await wire.interpolatePoints(interpolationOptions);\n\n // 5. Create an interpolated periodic wire that creates a closed smooth curve\n const interpolationPeriodicOptions = new InterpolationDto();\n interpolationPeriodicOptions.points = points;\n interpolationPeriodicOptions.periodic = true;\n interpolationPeriodicOptions.tolerance = 1e-7;\n const interpolatedPeriodicWire = await wire.interpolatePoints(interpolationPeriodicOptions);\n\n // 6. Create a Bezier curve using points as control points\n const bezierOptions = new BezierDto();\n bezierOptions.points = points;\n bezierOptions.closed = false;\n const bezierWire = await wire.createBezier(bezierOptions);\n\n // 7. Create a BSpline curve with specified degree\n const bsplineOptions = new BSplineDto();\n bsplineOptions.points = points;\n bsplineOptions.closed = false;\n const bsplineWire = await wire.createBSpline(bsplineOptions);\n\n // Translate wires to different Y positions for better visualization\n const translateOptions = new TranslateDto();\n\n // Translate polyline\n translateOptions.shape = polylineWire;\n translateOptions.translation = [0, 1, 0] as Vector3;\n const translatedPolyline = await transforms.translate(translateOptions);\n\n // Translate polygon\n translateOptions.shape = polygonWire;\n translateOptions.translation = [0, 2, 0] as Vector3;\n const translatedPolygon = await transforms.translate(translateOptions);\n\n // Translate interpolated wire\n translateOptions.shape = interpolatedWire;\n translateOptions.translation = [0, 3, 0] as Vector3;\n const translatedInterpolated = await transforms.translate(translateOptions);\n\n // Translate interpolated periodic wire\n translateOptions.shape = interpolatedPeriodicWire;\n translateOptions.translation = [0, 4, 0] as Vector3;\n const translatedInterpolatedPeriodic = await transforms.translate(translateOptions);\n\n // Translate Bezier wire\n translateOptions.shape = bezierWire;\n translateOptions.translation = [0, 5, 0] as Vector3;\n const translatedBezier = await transforms.translate(translateOptions);\n\n // Translate BSpline wire\n translateOptions.shape = bsplineWire;\n translateOptions.translation = [0, 6, 0] as Vector3;\n const translatedBSpline = await transforms.translate(translateOptions);\n\n // Draw all the created wires\n bitbybit.draw.drawAnyAsync({ entity: lineWire });\n bitbybit.draw.drawAnyAsync({ entity: translatedPolyline });\n bitbybit.draw.drawAnyAsync({ entity: translatedPolygon });\n bitbybit.draw.drawAnyAsync({ entity: translatedInterpolated });\n bitbybit.draw.drawAnyAsync({ entity: translatedInterpolatedPeriodic });\n bitbybit.draw.drawAnyAsync({ entity: translatedBezier });\n bitbybit.draw.drawAnyAsync({ entity: translatedBSpline });\n}\n\n// Execute the function\nstart();","version":"0.21.0","type":"typescript"}} title="Comprehensive wire creation from points" /> diff --git a/docs/learn/getting-started/basics/assets/local/gltf.mdx b/docs/learn/getting-started/basics/assets/local/gltf.mdx index cc657268..324ca090 100644 --- a/docs/learn/getting-started/basics/assets/local/gltf.mdx +++ b/docs/learn/getting-started/basics/assets/local/gltf.mdx @@ -59,7 +59,7 @@ Your Rete graph should now look similar to the setup in the embedded editor belo **Rete Editor Example:** @@ -101,7 +101,7 @@ After assembling the blocks, click "Run". You should see the BoomBox model. **Blockly Editor Example:** TRUEBoomBoxFALSE","version":"0.20.14","type":"blockly"}} + script={{"script":"TRUEBoomBoxFALSE","version":"0.21.0","type":"blockly"}} title="Bitbybit Blockly Editor - Using Local glTF Asset" description="Upload local asset from tutorial named accordingly and it will appear in 3D scene after you hit run." /> @@ -126,7 +126,7 @@ Here's the example code, which should be fairly self-explanatory for those famil **TypeScript Editor Example:** {\n bitbybit.babylon.scene.useRightHandedSystem({\n use: true,\n });\n const file = await bitbybit.asset.getLocalFile({\n fileName: \"BoomBox\"\n }) as File;\n await bitbybit.babylon.io.loadAssetIntoScene({\n assetFile: file,\n hidden: false\n });\n}\n\nstart();\n","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = async () => {\n bitbybit.babylon.scene.useRightHandedSystem({\n use: true,\n });\n const file = await bitbybit.asset.getLocalFile({\n fileName: \"BoomBox\"\n }) as File;\n await bitbybit.babylon.io.loadAssetIntoScene({\n assetFile: file,\n hidden: false\n });\n}\n\nstart();\n","version":"0.21.0","type":"typescript"}} title="Bitbybit Blockly Editor - Using Local glTF Asset" description="Upload local asset from tutorial named accordingly and it will appear in 3D scene after you hit run." /> diff --git a/docs/learn/getting-started/basics/assets/local/step.mdx b/docs/learn/getting-started/basics/assets/local/step.mdx index 5bfc0080..2dc2d9cf 100644 --- a/docs/learn/getting-started/basics/assets/local/step.mdx +++ b/docs/learn/getting-started/basics/assets/local/step.mdx @@ -54,7 +54,7 @@ That's it! Your Rete graph should be set up. It might take a moment for the Kuka **Rete Editor Example:** @@ -95,7 +95,7 @@ After assembling the blocks, click "Run". **Blockly Editor Example:** KukaRobotTRUE","version":"0.20.14","type":"blockly"}} + script={{"script":"KukaRobotTRUE","version":"0.21.0","type":"blockly"}} title="Bitbybit Blockly Editor - Using Local STEP Asset" description="Upload local asset from tutorial named accordingly and it will appear in 3D scene after you hit run." /> @@ -122,7 +122,7 @@ Here's an example of how to do that: **TypeScript Editor Example:** {\n\n const file = await bitbybit.asset.getLocalFile({\n fileName: \"KukaRobot\"\n }) as File;\n\n const shape = await bitbybit.occt.io.loadSTEPorIGES({\n assetFile: file,\n adjustZtoY: true,\n });\n\n bitbybit.draw.drawAnyAsync({\n entity: shape\n })\n}\n\nstart();\n","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = async () => {\n\n const file = await bitbybit.asset.getLocalFile({\n fileName: \"KukaRobot\"\n }) as File;\n\n const shape = await bitbybit.occt.io.loadSTEPorIGES({\n assetFile: file,\n adjustZtoY: true,\n });\n\n bitbybit.draw.drawAnyAsync({\n entity: shape\n })\n}\n\nstart();\n","version":"0.21.0","type":"typescript"}} title="Bitbybit TypeScript Editor - Using Local STEP Asset" description="Upload local asset from tutorial named accordingly and it will appear in 3D scene after you hit run." /> diff --git a/docs/learn/getting-started/blockly/hello-world.mdx b/docs/learn/getting-started/blockly/hello-world.mdx index 2109d89f..45eaae9e 100644 --- a/docs/learn/getting-started/blockly/hello-world.mdx +++ b/docs/learn/getting-started/blockly/hello-world.mdx @@ -56,7 +56,7 @@ Your setup should resemble this interactive example: Hello World!'Aboreto''Regular'1.50.20000010'leftTop'","version":"0.20.14","type":"blockly"}} + script={{"script":"Hello World!'Aboreto''Regular'1.50.20000010'leftTop'","version":"0.21.0","type":"blockly"}} title="Draw 3D Text" description="Draws the text on the screen." /> @@ -88,7 +88,7 @@ After completing these steps, your Blockly script should look similar to this: 40040010100.450.50.5FALSE#ffffff#ffffffHello World!'Roboto''Regular'1.50.2-9000000-1'centerBottom'","version":"0.20.14","type":"blockly"}} + script={{"script":"40040010100.450.50.5FALSE#ffffff#ffffffHello World!'Roboto''Regular'1.50.2-9000000-1'centerBottom'","version":"0.21.0","type":"blockly"}} title="Draw 3D text and grid" description="Draws 3D text and the grid on the screen. Text is placed in better orientation." /> diff --git a/docs/learn/getting-started/blockly/parametric-cube.mdx b/docs/learn/getting-started/blockly/parametric-cube.mdx index f11d2f7b..c8dfadb4 100644 --- a/docs/learn/getting-started/blockly/parametric-cube.mdx +++ b/docs/learn/getting-started/blockly/parametric-cube.mdx @@ -69,7 +69,7 @@ Your Blockly workspace should now look something like this interactive example: sizesize3size000","version":"0.20.14","type":"blockly"}} + script={{"script":"sizesize3size000","version":"0.21.0","type":"blockly"}} title="Parametric cube example" description="Draws the parametrically controlled cube." /> diff --git a/docs/learn/getting-started/rete/hello-world.mdx b/docs/learn/getting-started/rete/hello-world.mdx index 2cbcf06b..30dd5e63 100644 --- a/docs/learn/getting-started/rete/hello-world.mdx +++ b/docs/learn/getting-started/rete/hello-world.mdx @@ -41,7 +41,7 @@ If you've done it correctly, your canvas should have the "Draw Grid Mesh" compon @@ -79,7 +79,7 @@ The setup should resemble this: @@ -109,7 +109,7 @@ Here's the final result you should aim for: diff --git a/docs/learn/getting-started/rete/parametric-cube.mdx b/docs/learn/getting-started/rete/parametric-cube.mdx index be8dbf57..16e6073e 100644 --- a/docs/learn/getting-started/rete/parametric-cube.mdx +++ b/docs/learn/getting-started/rete/parametric-cube.mdx @@ -44,7 +44,7 @@ We'll use the OpenCascade Technology (OCCT) geometry kernel to create our cube. @@ -69,7 +69,7 @@ If you've connected them correctly, your setup should resemble the following int diff --git a/docs/learn/getting-started/typescript/hello-world.mdx b/docs/learn/getting-started/typescript/hello-world.mdx index 1b9a58b8..0268ef33 100644 --- a/docs/learn/getting-started/typescript/hello-world.mdx +++ b/docs/learn/getting-started/typescript/hello-world.mdx @@ -26,7 +26,7 @@ Check out the script below: {\n const gridOptions = new Bit.Inputs.Draw.SceneDrawGridMeshDto();\n bitbybit.draw.drawGridMesh(gridOptions);\n}\n\nstart();\n","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = async () => {\n const gridOptions = new Bit.Inputs.Draw.SceneDrawGridMeshDto();\n bitbybit.draw.drawGridMesh(gridOptions);\n}\n\nstart();\n","version":"0.21.0","type":"typescript"}} title="Draw the grid" description="Draws the grid mesh with lines in 3D space." /> @@ -51,7 +51,7 @@ The script below shows a working example. We've set the `rotation` to -90 degree {\n const gridOptions = new Bit.Inputs.Draw.SceneDrawGridMeshDto();\n bitbybit.draw.drawGridMesh(gridOptions);\n\n const textOpt = new Bit.Advanced.Text3D.Text3DDto();\n textOpt.text = \"Hello World!\";\n textOpt.rotation = -90;\n textOpt.originAlignment = Bit.Advanced.Text3D.recAlignmentEnum.centerBottom;\n textOpt.direction = [0, 0, -1];\n const text3D = await bitbybit.advanced.text3d.create(textOpt);\n\n bitbybit.draw.drawAnyAsync({\n entity: text3D\n });\n}\n\nstart();\n","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = async () => {\n const gridOptions = new Bit.Inputs.Draw.SceneDrawGridMeshDto();\n bitbybit.draw.drawGridMesh(gridOptions);\n\n const textOpt = new Bit.Advanced.Text3D.Text3DDto();\n textOpt.text = \"Hello World!\";\n textOpt.rotation = -90;\n textOpt.originAlignment = Bit.Advanced.Text3D.recAlignmentEnum.centerBottom;\n textOpt.direction = [0, 0, -1];\n const text3D = await bitbybit.advanced.text3d.create(textOpt);\n\n bitbybit.draw.drawAnyAsync({\n entity: text3D\n });\n}\n\nstart();\n","version":"0.21.0","type":"typescript"}} title="Draw the text & grid" description="Draws the grid mesh with text in 3D space." /> diff --git a/docs/learn/getting-started/typescript/how-to-code-in-monaco.md b/docs/learn/getting-started/typescript/how-to-code-in-monaco.md index 5a00e009..997b0b99 100644 --- a/docs/learn/getting-started/typescript/how-to-code-in-monaco.md +++ b/docs/learn/getting-started/typescript/how-to-code-in-monaco.md @@ -197,7 +197,7 @@ start(); {\n // Step 3a: Create input objects (DTOs) and set their properties for a cube\n const cubeOptions = new CubeDto(); // Instantiate the DTO\n cubeOptions.size = 6; // Set the cube's size\n // Call the bitbybit function to create the cube, awaiting its promise\n const cube: TopoDSShapePointer = await solid.createCube(cubeOptions);\n\n // Step 3b: Create input objects (DTOs) for a sphere\n const sphereOptions = new SphereDto();\n sphereOptions.radius = 3;\n sphereOptions.center = [3, 3, -3]; // Define center as [x, y, z] coordinates\n const sphere: TopoDSShapePointer = await solid.createSphere(sphereOptions);\n\n // Step 4: Perform geometric operations\n // Example: Boolean difference (subtract sphere from cube)\n const diffOptions = new DifferenceDto(); // Generic type for the shapes involved\n diffOptions.shape = cube; // The base shape\n diffOptions.shapes = [sphere]; // An array of shapes to subtract\n const diff: TopoDSShapePointer = await booleans.difference(diffOptions);\n\n // Example: Apply fillets (round edges) to the result of the difference\n const roundingOptions = new FilletDto();\n roundingOptions.shape = diff; // The shape to fillet\n roundingOptions.radius = 1; // The radius of the fillet\n // Note: Some operations might have specific methods like 'filletEdges' for common tasks\n const solidRoundedCorners: TopoDSShapePointer = await fillets.filletEdges(roundingOptions);\n\n // Step 5: Visualize the result in the 3D viewer\n // Prepare drawing options to customize appearance\n const occtDrawOptions = new DrawOcctShapeOptions();\n occtDrawOptions.faceColour = \"#0000ff\"; // Blue faces\n occtDrawOptions.edgeColour = \"#ff00ff\"; // Magenta edges\n occtDrawOptions.edgeWidth = 5; // Width of the edges\n occtDrawOptions.precision = 0.001; // Rendering precision for complex shapes (lower is finer)\n // Draw the final shape. 'drawAnyAsync' is a versatile function for drawing various entity types.\n draw.drawAnyAsync({ entity: solidRoundedCorners, options: occtDrawOptions });\n\n // Step 6: (Optional) Adjust scene elements like lighting for better visualization\n const dirLight = new DirectionalLightDto();\n dirLight.shadowGeneratorMapSize = 2000; // Higher values for better shadow quality\n dirLight.intensity = 3; // Light intensity\n scene.drawDirectionalLight(dirLight); // Adds or updates a directional light in the scene\n\n // Step 7: (Optional) Export your model to common CAD file formats\n // Export as STEP file (a common format for solid models)\n const stepExportOptions = new SaveStepDto();\n stepExportOptions.shape = solidRoundedCorners;\n stepExportOptions.adjustYtoZ = true; // Optional: Adjusts coordinate system (Y-up to Z-up) if needed\n stepExportOptions.fileName = \"cube_with_sphere_cutout.step\";\n stepExportOptions.tryDownload = true; // Attempts to trigger a browser download of the file\n await io.saveShapeSTEP(stepExportOptions); // Use the destructured 'io'\n\n // Export as STL file (a common format for 3D printing)\n const stlExportOptions = new SaveStlDto();\n stlExportOptions.shape = solidRoundedCorners;\n stlExportOptions.adjustYtoZ = true;\n stlExportOptions.fileName = \"cube_with_sphere_cutout.stl\";\n stlExportOptions.precision = 0.001; // Affects STL mesh quality (smaller values for finer mesh)\n stlExportOptions.tryDownload = true;\n await io.saveShapeStl(stlExportOptions); // Use the destructured 'io'\n};\n\n// Step 8: Call the start function to execute your script\nstart();","version":"0.20.14","type":"typescript"}} + script={{"script":"// Step 1: (Optional but Recommended) Destructure for convenience\n// This makes your code less verbose and easier to read.\nconst { solid } = bitbybit.occt.shapes;\nconst { booleans, fillets, io } = bitbybit.occt; // Added 'io' for export functions\nconst { draw } = bitbybit;\nconst { scene } = bitbybit.babylon;\n\n// Step 2: Import type definitions for input objects and shapes\n// This enables type checking and autocompletion.\ntype TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer; // Represents an OCCT shape\n\nconst { CubeDto, SphereDto, FilletDto, DifferenceDto, SaveStepDto, SaveStlDto } = Bit.Inputs.OCCT;\nconst DrawOcctShapeOptions = Bit.Inputs.Draw.DrawOcctShapeOptions;\nconst DirectionalLightDto = Bit.Inputs.BabylonScene.DirectionalLightDto;\n\n// Step 3: Define your main logic within an async function\nconst start = async () => {\n // Step 3a: Create input objects (DTOs) and set their properties for a cube\n const cubeOptions = new CubeDto(); // Instantiate the DTO\n cubeOptions.size = 6; // Set the cube's size\n // Call the bitbybit function to create the cube, awaiting its promise\n const cube: TopoDSShapePointer = await solid.createCube(cubeOptions);\n\n // Step 3b: Create input objects (DTOs) for a sphere\n const sphereOptions = new SphereDto();\n sphereOptions.radius = 3;\n sphereOptions.center = [3, 3, -3]; // Define center as [x, y, z] coordinates\n const sphere: TopoDSShapePointer = await solid.createSphere(sphereOptions);\n\n // Step 4: Perform geometric operations\n // Example: Boolean difference (subtract sphere from cube)\n const diffOptions = new DifferenceDto(); // Generic type for the shapes involved\n diffOptions.shape = cube; // The base shape\n diffOptions.shapes = [sphere]; // An array of shapes to subtract\n const diff: TopoDSShapePointer = await booleans.difference(diffOptions);\n\n // Example: Apply fillets (round edges) to the result of the difference\n const roundingOptions = new FilletDto();\n roundingOptions.shape = diff; // The shape to fillet\n roundingOptions.radius = 1; // The radius of the fillet\n // Note: Some operations might have specific methods like 'filletEdges' for common tasks\n const solidRoundedCorners: TopoDSShapePointer = await fillets.filletEdges(roundingOptions);\n\n // Step 5: Visualize the result in the 3D viewer\n // Prepare drawing options to customize appearance\n const occtDrawOptions = new DrawOcctShapeOptions();\n occtDrawOptions.faceColour = \"#0000ff\"; // Blue faces\n occtDrawOptions.edgeColour = \"#ff00ff\"; // Magenta edges\n occtDrawOptions.edgeWidth = 5; // Width of the edges\n occtDrawOptions.precision = 0.001; // Rendering precision for complex shapes (lower is finer)\n // Draw the final shape. 'drawAnyAsync' is a versatile function for drawing various entity types.\n draw.drawAnyAsync({ entity: solidRoundedCorners, options: occtDrawOptions });\n\n // Step 6: (Optional) Adjust scene elements like lighting for better visualization\n const dirLight = new DirectionalLightDto();\n dirLight.shadowGeneratorMapSize = 2000; // Higher values for better shadow quality\n dirLight.intensity = 3; // Light intensity\n scene.drawDirectionalLight(dirLight); // Adds or updates a directional light in the scene\n\n // Step 7: (Optional) Export your model to common CAD file formats\n // Export as STEP file (a common format for solid models)\n const stepExportOptions = new SaveStepDto();\n stepExportOptions.shape = solidRoundedCorners;\n stepExportOptions.adjustYtoZ = true; // Optional: Adjusts coordinate system (Y-up to Z-up) if needed\n stepExportOptions.fileName = \"cube_with_sphere_cutout.step\";\n stepExportOptions.tryDownload = true; // Attempts to trigger a browser download of the file\n await io.saveShapeSTEP(stepExportOptions); // Use the destructured 'io'\n\n // Export as STL file (a common format for 3D printing)\n const stlExportOptions = new SaveStlDto();\n stlExportOptions.shape = solidRoundedCorners;\n stlExportOptions.adjustYtoZ = true;\n stlExportOptions.fileName = \"cube_with_sphere_cutout.stl\";\n stlExportOptions.precision = 0.001; // Affects STL mesh quality (smaller values for finer mesh)\n stlExportOptions.tryDownload = true;\n await io.saveShapeStl(stlExportOptions); // Use the destructured 'io'\n};\n\n// Step 8: Call the start function to execute your script\nstart();","version":"0.21.0","type":"typescript"}} title="Create And Download STEP & STL 3D Models" description="Contains example code that can be executed directly inside the editor by clicking Run button." /> diff --git a/docs/learn/getting-started/typescript/parametric-cube.mdx b/docs/learn/getting-started/typescript/parametric-cube.mdx index 0fa455cf..aae81a37 100644 --- a/docs/learn/getting-started/typescript/parametric-cube.mdx +++ b/docs/learn/getting-started/typescript/parametric-cube.mdx @@ -35,7 +35,7 @@ The script shown in the editor below is fairly straightforward, but let's break {\n const size = 10;\n const cubeOptions = new Bit.Inputs.OCCT.CubeDto();\n cubeOptions.size = size;\n const cube = await bitbybit.occt.shapes.solid.createCube(cubeOptions);\n\n bitbybit.draw.drawAnyAsync({\n entity: cube\n });\n}\n\nstart();\n","version":"0.20.14","type":"typescript"}} + script={{"script":"const start = async () => {\n const size = 10;\n const cubeOptions = new Bit.Inputs.OCCT.CubeDto();\n cubeOptions.size = size;\n const cube = await bitbybit.occt.shapes.solid.createCube(cubeOptions);\n\n bitbybit.draw.drawAnyAsync({\n entity: cube\n });\n}\n\nstart();\n","version":"0.21.0","type":"typescript"}} title="Draw the grid" description="Draws the grid mesh with lines in 3D space." /> diff --git a/docs/learn/getting-started/viewer-editor/basics/getting-started.md b/docs/learn/getting-started/viewer-editor/basics/getting-started.md index 23f7eafd..5f06fd4d 100644 --- a/docs/learn/getting-started/viewer-editor/basics/getting-started.md +++ b/docs/learn/getting-started/viewer-editor/basics/getting-started.md @@ -139,7 +139,7 @@ When you export, you get JSON like this: ```json { - "$schema": "https://app-store.bitbybit.dev/files/ecommerce/viewer-editor/viewer-scene-schema-v0.20.14.json", + "$schema": "https://app-store.bitbybit.dev/files/ecommerce/viewer-editor/viewer-scene-schema-v0.21.0.json", "models": [ { "name": "Main Product", diff --git a/docs/learn/getting-started/viewer-editor/basics/overview.md b/docs/learn/getting-started/viewer-editor/basics/overview.md index 17f25dfc..22956577 100644 --- a/docs/learn/getting-started/viewer-editor/basics/overview.md +++ b/docs/learn/getting-started/viewer-editor/basics/overview.md @@ -78,7 +78,7 @@ For Shopify users, see [Subscription Plans](../../../3d-bits/plans/subscription- ## Generated Output -The Viewer Editor generates valid JSON that conforms to the [**Viewer Scene Schema**](https://app-store.bitbybit.dev/files/ecommerce/viewer-editor/viewer-scene-schema-v0.20.14.json). This JSON can be: +The Viewer Editor generates valid JSON that conforms to the [**Viewer Scene Schema**](https://app-store.bitbybit.dev/files/ecommerce/viewer-editor/viewer-scene-schema-v0.21.0.json). This JSON can be: - Copied to clipboard and pasted into Shopify product metafields - Downloaded as a file and hosted on your CDN diff --git a/docs/learn/open-source-approach.md b/docs/learn/open-source-approach.md index 93a52f82..2e99ae98 100644 --- a/docs/learn/open-source-approach.md +++ b/docs/learn/open-source-approach.md @@ -35,6 +35,7 @@ We are committed to open-sourcing the foundational elements that empower develop * `bitbybit.text` * `bitbybit.dates` * `bitbybit.json` + * `bitbybit.csv` * `bitbybit.verb` * `bitbybit.tag` * `bitbybit.time` @@ -84,6 +85,10 @@ To support the development and hosting of the Bitbybit platform, certain compone Being able to *use* a feature (e.g., running a script with an advanced algorithm via our platform or a Runner) is different from having access to its *source code*. +4. **[3D Bits](/learn/3d-bits/intro) app for Shopify:** + * This E-Commerce application is fully proprietary and is not shared as open-source project. It is meant to serve commercial B2B customers of Bit by bit developers company. + * There are no plans to open-source any part of this application such as [Viewer Editor](/learn/getting-started/viewer-editor/intro) or other related tools. + ## Our Commitment to Transparency We aim to be as transparent as possible about our open source model. diff --git a/docs/learn/runners/intro-blockly.mdx b/docs/learn/runners/intro-blockly.mdx index b8126267..3fa38f6d 100644 --- a/docs/learn/runners/intro-blockly.mdx +++ b/docs/learn/runners/intro-blockly.mdx @@ -48,7 +48,7 @@ The following Bitbybit Blockly script is the visual program we'll be creating. T sizecubeMeshsizesizesizesize1cubeMeshsize0000.40.005TRUE#000099TRUE#ffffff1cubeMeshcubeMesh","version":"0.20.14","type":"blockly"}} + script={{"script":"sizecubeMeshsizesizesizesize1cubeMeshsize0000.40.005TRUE#000099TRUE#ffffff1cubeMeshcubeMesh","version":"0.21.0","type":"blockly"}} title="Bitbybit Blockly Editor - Simple Cube for Runner Tutorial" description="Draws 3D Cube and controls its size via inputs coming from external executing program" /> @@ -68,7 +68,7 @@ Below are the `index.html` and `script.js` files you would use on StackBlitz or - + diff --git a/docs/learn/runners/intro-rete.mdx b/docs/learn/runners/intro-rete.mdx index 76c0bc84..fd2ea2d9 100644 --- a/docs/learn/runners/intro-rete.mdx +++ b/docs/learn/runners/intro-rete.mdx @@ -51,7 +51,7 @@ The following Bitbybit Rete script is the visual program we'll be creating. The diff --git a/docs/learn/runners/intro-typescript.mdx b/docs/learn/runners/intro-typescript.mdx index c43499c3..c78720c9 100644 --- a/docs/learn/runners/intro-typescript.mdx +++ b/docs/learn/runners/intro-typescript.mdx @@ -46,7 +46,7 @@ The following is the Bitbybit TypeScript script we'll be creating. The JavaScrip {\n const cube = await occt.shapes.solid.createCube({\n size: inputs.size,\n center: [0, 0, 0],\n });\n const filletCube = await occt.fillets.filletEdges({\n shape: cube,\n radius: 0.4\n });\n const drawOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n drawOptions.faceColour = \"#0000ff\";\n drawOptions.edgeWidth = 1;\n drawOptions.precision = 0.005;\n const cubeMesh = await bitbybit.draw.drawAnyAsync({\n entity: filletCube,\n options: drawOptions,\n });\n return { cubeMesh };\n}\n\nconst runnerOutput = start();\nBit.setBitbybitRunnerResult(runnerOutput);\n","version":"0.20.14","type":"typescript"}} + script={{"script":"type Inputs = {\n size: number;\n}\n\nBit.mockBitbybitRunnerInputs({ size: 1 });\nconst inputs: Inputs = Bit.getBitbybitRunnerInputs();\n\nconst { occt } = bitbybit;\n\nconst start = async () => {\n const cube = await occt.shapes.solid.createCube({\n size: inputs.size,\n center: [0, 0, 0],\n });\n const filletCube = await occt.fillets.filletEdges({\n shape: cube,\n radius: 0.4\n });\n const drawOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n drawOptions.faceColour = \"#0000ff\";\n drawOptions.edgeWidth = 1;\n drawOptions.precision = 0.005;\n const cubeMesh = await bitbybit.draw.drawAnyAsync({\n entity: filletCube,\n options: drawOptions,\n });\n return { cubeMesh };\n}\n\nconst runnerOutput = start();\nBit.setBitbybitRunnerResult(runnerOutput);\n","version":"0.21.0","type":"typescript"}} title="Bitbybit TypeScript Editor - Simple Cube for Runner Tutorial" description="Draws 3D Cube and controls its size via inputs coming from external executing program" /> diff --git a/docs/learn/runners/live-examples/configurable-cad-part.mdx b/docs/learn/runners/live-examples/configurable-cad-part.mdx index c602104c..3b380d42 100644 --- a/docs/learn/runners/live-examples/configurable-cad-part.mdx +++ b/docs/learn/runners/live-examples/configurable-cad-part.mdx @@ -30,7 +30,7 @@ Below is an interactive preview of the Rete visual program. Notice how this scri diff --git a/docs/learn/runners/table-configurator-blockly.mdx b/docs/learn/runners/table-configurator-blockly.mdx index 28702d96..2191030a 100644 --- a/docs/learn/runners/table-configurator-blockly.mdx +++ b/docs/learn/runners/table-configurator-blockly.mdx @@ -46,7 +46,7 @@ The following Bitbybit Blockly script is the visual program that defines the log widthlengthlegHeightheighthalfLegheightthicknesshalfThicknesswidthOffsetlengthOffsetlegShapecompoundShapetable'clearSky'10000.10.7-100-100-1003#ffffff#ffffff1024TRUE0legHeightMINUSheightthicknesshalfLegheightDIVIDElegHeight2halfThicknessDIVIDEthickness2widthOffsetMINUSDIVIDEwidth2halfThicknesslengthOffsetMINUSDIVIDElength2halfThicknesslegShapethicknessthicknesslegHeight000compoundShapewidthlengththickness0MINUSheighthalfThickness0legShapewidthOffsethalfLegheightlengthOffsetlegShapeNEGwidthOffsethalfLegheightlengthOffsetlegShapewidthOffsethalfLegheightNEGlengthOffsetlegShapeNEGwidthOffsethalfLegheightNEGlengthOffset2000010tablecompoundShape0.01TRUE#999999TRUE#ffffff1tabletablesetupParamsDescribe this function...widthwidthlengthlengthheightheightthicknessthicknesswidthwidth1lengthlength1heightheight0.5thicknessthickness0.05","version":"0.20.14","type":"blockly"}} + script={{"script":"widthlengthlegHeightheighthalfLegheightthicknesshalfThicknesswidthOffsetlengthOffsetlegShapecompoundShapetable'clearSky'10000.10.7-100-100-1003#ffffff#ffffff1024TRUE0legHeightMINUSheightthicknesshalfLegheightDIVIDElegHeight2halfThicknessDIVIDEthickness2widthOffsetMINUSDIVIDEwidth2halfThicknesslengthOffsetMINUSDIVIDElength2halfThicknesslegShapethicknessthicknesslegHeight000compoundShapewidthlengththickness0MINUSheighthalfThickness0legShapewidthOffsethalfLegheightlengthOffsetlegShapeNEGwidthOffsethalfLegheightlengthOffsetlegShapewidthOffsethalfLegheightNEGlengthOffsetlegShapeNEGwidthOffsethalfLegheightNEGlengthOffset2000010tablecompoundShape0.01TRUE#999999TRUE#ffffff1tabletablesetupParamsDescribe this function...widthwidthlengthlengthheightheightthicknessthicknesswidthwidth1lengthlength1heightheight0.5thicknessthickness0.05","version":"0.21.0","type":"blockly"}} title="Bitbybit Blockly Editor - Simple Cube for Runner Tutorial" description="Draws 3D Table and controls its size via inputs coming from external executing program" /> @@ -66,7 +66,7 @@ Below are the `index.html` and `script.js` files you would use on StackBlitz or - + diff --git a/docs/learn/runners/table-configurator-rete.mdx b/docs/learn/runners/table-configurator-rete.mdx index 4e27b743..b6f9a140 100644 --- a/docs/learn/runners/table-configurator-rete.mdx +++ b/docs/learn/runners/table-configurator-rete.mdx @@ -46,7 +46,7 @@ The following Bitbybit Rete script is the visual program that defines the logic diff --git a/docs/learn/runners/table-configurator-typescript.mdx b/docs/learn/runners/table-configurator-typescript.mdx index d663739b..1b7369b3 100644 --- a/docs/learn/runners/table-configurator-typescript.mdx +++ b/docs/learn/runners/table-configurator-typescript.mdx @@ -51,7 +51,7 @@ The following Bitbybit TypeScript script is the program that defines the logic f {\n\n const skyboxOptions = new Bit.Inputs.BabylonScene.SkyboxDto();\n skyboxOptions.skybox = Bit.Inputs.Base.skyboxEnum.clearSky;\n bitbybit.babylon.scene.enableSkybox(skyboxOptions);\n\n const lightOptions = new Bit.Inputs.BabylonScene.DirectionalLightDto();\n lightOptions.intensity = 3;\n bitbybit.babylon.scene.drawDirectionalLight(lightOptions);\n\n const tableTopShape = await solid.createBox({\n width: inputs.width,\n length: inputs.length,\n height: inputs.thickness,\n center: [0, inputs.height - halfThickness, 0],\n });\n\n const leg1Shape = await solid.createBox({\n width: inputs.thickness,\n length: inputs.thickness,\n height: legHeight,\n center: [widthOffset, halfLegHeight, lengthOffset],\n });\n const leg2Shape = await solid.createBox({\n width: inputs.thickness,\n length: inputs.thickness,\n height: legHeight,\n center: [-widthOffset, halfLegHeight, lengthOffset],\n });\n const leg3Shape = await solid.createBox({\n width: inputs.thickness,\n length: inputs.thickness,\n height: legHeight,\n center: [widthOffset, halfLegHeight, -lengthOffset],\n });\n const leg4Shape = await solid.createBox({\n width: inputs.thickness,\n length: inputs.thickness,\n height: legHeight,\n center: [-widthOffset, halfLegHeight, -lengthOffset],\n });\n\n const groundShape = await face.createCircleFace({\n radius: 2,\n center: [0, 0, 0],\n direction: [0, 1, 0]\n });\n\n const compoundShape = await compound.makeCompound({\n shapes: [tableTopShape, leg1Shape, leg2Shape, leg3Shape, leg4Shape, groundShape],\n });\n\n const drawOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n drawOptions.faceColour = \"#555577\";\n drawOptions.edgeWidth = 1;\n const table = await bitbybit.draw.drawAnyAsync({ entity: compoundShape, options: drawOptions });\n return { table };\n}\n\nconst runnerOutput = start();\nBit.setBitbybitRunnerResult(runnerOutput);\n","version":"0.20.14","type":"typescript"}} + script={{"script":"type Inputs = {\n width: number;\n length: number;\n height: number;\n thickness: number;\n};\n\nconst defaultValues: Inputs = {\n width: 1,\n length: 1,\n height: 0.5,\n thickness: 0.05,\n};\n\nBit.mockBitbybitRunnerInputs(defaultValues);\nconst inputs: Inputs = Bit.getBitbybitRunnerInputs();\n\nconst { solid, compound, face } = bitbybit.occt.shapes;\n\nconst legHeight = inputs.height - inputs.thickness;\nconst halfLegHeight = legHeight / 2;\nconst halfThickness = inputs.thickness / 2;\nconst widthOffset = inputs.width / 2 - halfThickness;\nconst lengthOffset = inputs.length / 2 - halfThickness;\n\n\nconst start = async () => {\n\n const skyboxOptions = new Bit.Inputs.BabylonScene.SkyboxDto();\n skyboxOptions.skybox = Bit.Inputs.Base.skyboxEnum.clearSky;\n bitbybit.babylon.scene.enableSkybox(skyboxOptions);\n\n const lightOptions = new Bit.Inputs.BabylonScene.DirectionalLightDto();\n lightOptions.intensity = 3;\n bitbybit.babylon.scene.drawDirectionalLight(lightOptions);\n\n const tableTopShape = await solid.createBox({\n width: inputs.width,\n length: inputs.length,\n height: inputs.thickness,\n center: [0, inputs.height - halfThickness, 0],\n });\n\n const leg1Shape = await solid.createBox({\n width: inputs.thickness,\n length: inputs.thickness,\n height: legHeight,\n center: [widthOffset, halfLegHeight, lengthOffset],\n });\n const leg2Shape = await solid.createBox({\n width: inputs.thickness,\n length: inputs.thickness,\n height: legHeight,\n center: [-widthOffset, halfLegHeight, lengthOffset],\n });\n const leg3Shape = await solid.createBox({\n width: inputs.thickness,\n length: inputs.thickness,\n height: legHeight,\n center: [widthOffset, halfLegHeight, -lengthOffset],\n });\n const leg4Shape = await solid.createBox({\n width: inputs.thickness,\n length: inputs.thickness,\n height: legHeight,\n center: [-widthOffset, halfLegHeight, -lengthOffset],\n });\n\n const groundShape = await face.createCircleFace({\n radius: 2,\n center: [0, 0, 0],\n direction: [0, 1, 0]\n });\n\n const compoundShape = await compound.makeCompound({\n shapes: [tableTopShape, leg1Shape, leg2Shape, leg3Shape, leg4Shape, groundShape],\n });\n\n const drawOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n drawOptions.faceColour = \"#555577\";\n drawOptions.edgeWidth = 1;\n const table = await bitbybit.draw.drawAnyAsync({ entity: compoundShape, options: drawOptions });\n return { table };\n}\n\nconst runnerOutput = start();\nBit.setBitbybitRunnerResult(runnerOutput);\n","version":"0.21.0","type":"typescript"}} title="Bitbybit TypeScript Editor - 3D Table Configurator" description="Draws 3D Table and controls its size via inputs coming from external executing program" /> diff --git a/examples/LICENSE b/examples/LICENSE index 87a328f2..f82c4c75 100644 --- a/examples/LICENSE +++ b/examples/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025 Bit By Bit Developers +Copyright (c) 2026 Bit by bit developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/examples/angular/babylonjs/laptop-holder/package-lock.json b/examples/angular/babylonjs/laptop-holder/package-lock.json index 99e0cc2b..fe74d691 100644 --- a/examples/angular/babylonjs/laptop-holder/package-lock.json +++ b/examples/angular/babylonjs/laptop-holder/package-lock.json @@ -17,7 +17,7 @@ "@angular/platform-browser": "13.3.0", "@angular/platform-browser-dynamic": "13.3.0", "@angular/router": "13.3.0", - "@bitbybit-dev/babylonjs": "0.20.14", + "@bitbybit-dev/babylonjs": "0.21.0", "rxjs": "7.5.5", "tslib": "2.3.1", "zone.js": "0.11.5" @@ -2331,15 +2331,15 @@ } }, "node_modules/@babylonjs/core": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.42.0.tgz", - "integrity": "sha512-Jg8bJrTW4XgcB8tssIkvW8/M2uoVcbH662cYSn2/e5jim5SVbeS3hdbtk9t56s5MJnfJoOQgkz3+hFtWjM3Tmg==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.44.1.tgz", + "integrity": "sha512-sF2WWK2d7lg18ESOCxUoRG4d1SzCWz42asjRjRGxZ8r3D7w9ZM3H2wftJIqwaZvD3zWr+wmCVKpQ6hWkboHIXw==", "license": "Apache-2.0" }, "node_modules/@babylonjs/gui": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.42.0.tgz", - "integrity": "sha512-Ayp0AhAKtPUDXrMFmgtP+PcQTQIlTkQfe20dXFakchSBBHvmoqNiBSwN7rN40XlJPps3pOaDuZsDoboJWkJxCQ==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.44.1.tgz", + "integrity": "sha512-6STDK+Hr8GpY29YMLKnTVhEnWw1NKPrIpz+MqgWuoAAmmpiFtNCr0nnAnCj5fhgGf25L89jy51ogXyg3jfiuDA==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0" @@ -2354,9 +2354,9 @@ } }, "node_modules/@babylonjs/loaders": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.42.0.tgz", - "integrity": "sha512-sDthqDlgU7Nn4J/TcWFwsh8+ZJqp/tQtexLYlyDxs0VXInSwu9Hm1oCCCuKAdU/e9t4Qr5+ZpfnTDa4s0PcqBA==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.44.1.tgz", + "integrity": "sha512-h5rUGCwhdWv3Hq48DP8sy4/+3QUYjOprxu2i6zXKb69LHMnYE0tZ1xQHBJEOUF60hxA+TwhzdjC8bxInKoeojA==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0", @@ -2364,18 +2364,18 @@ } }, "node_modules/@babylonjs/materials": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.42.0.tgz", - "integrity": "sha512-fZsc+HWDlh4qrSeC2vfjmki4854V1o9NNIQvukZhkEoT8FsHqMaUUDn6EFRjrA1TBn4SU14uxTOPWrEGvMT/ag==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.44.1.tgz", + "integrity": "sha512-FD0S/aA68oEjKCSNY5ydGkiHbsyo08KlhQ+6R8swtJhx5aq7ojWBt3P9KC78+wjZiCJW37176CIObcV8QcjMAQ==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.6.0" } }, "node_modules/@babylonjs/serializers": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.42.0.tgz", - "integrity": "sha512-VptrGNtGHn+hqpeev/ozJsPBrAn35s76rNZIdrmrLHIEJIWSo30IgNy4oZRNITcwqJ0H5Bv2r8QqBYZzQifPOg==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.44.1.tgz", + "integrity": "sha512-3FRRdKpHr2qTkALHEvq0ih0P59iTINUFrGZWFUfO3Wu24UBSuTxY9Kq820dvUUWaRtWkXEnMSQbR+5glzcfqBw==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0", @@ -2383,49 +2383,49 @@ } }, "node_modules/@bitbybit-dev/babylonjs": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.14.tgz", - "integrity": "sha512-5V0HlvP8IZoTMSIaaafobWmFHnwf/nXKkQF2fvDNtw2urLFUJV08SVz8FggAjQTKZHNbmDp69ovJqQmEes7+HQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.21.0.tgz", + "integrity": "sha512-8aPJ+XTXzcnO4bXfmW34lTnVCzC6Hy6TMkh7/ziQSoUsjPp7e7LFHoBBfqCk09LdTLa85gb5x/f6WNAn306Odg==", "license": "MIT", "dependencies": { - "@babylonjs/core": "8.42.0", - "@babylonjs/gui": "8.42.0", + "@babylonjs/core": "8.44.1", + "@babylonjs/gui": "8.44.1", "@babylonjs/havok": "1.3.10", - "@babylonjs/loaders": "8.42.0", - "@babylonjs/materials": "8.42.0", - "@babylonjs/serializers": "8.42.0", - "@bitbybit-dev/core": "0.20.14", + "@babylonjs/loaders": "8.44.1", + "@babylonjs/materials": "8.44.1", + "@babylonjs/serializers": "8.44.1", + "@bitbybit-dev/core": "0.21.0", "earcut": "2.2.3" } }, "node_modules/@bitbybit-dev/base": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.14.tgz", - "integrity": "sha512-Nv8eEwoVDU0Ug3TJIyzPtvIX03whvVIWsUw0xTkImFISUWmU0v1rNSaEd9FL9Rx7rMt2MC9Cxs3lXLkhZS3iAQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.21.0.tgz", + "integrity": "sha512-dNfsf2tu3/QUD1mvZzzTze8RwHyK2Jrt+Ary8EDKdNKMw+abtCpQYNerdrg0ZQPxvwu/OOQz6N1xCsCwsPkQJg==", "license": "MIT" }, "node_modules/@bitbybit-dev/core": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.14.tgz", - "integrity": "sha512-meYYY5SEfoT+NEiM2W2lpwBWtFZzvRzrTcOuzDn/uNgmzyIqUARGYZroQgGEG9XmGiCUEfeYDc7Q7ML2aesyxg==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.21.0.tgz", + "integrity": "sha512-IbeQ8ROreu0/RkkngUE+Eb19ecvqKOWhGefXvIqQmplxt3zEc0FI4Kw8wR3vYl2XMannuVt1xAIYtqqH0tjBzg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14", - "@bitbybit-dev/jscad-worker": "0.20.14", - "@bitbybit-dev/manifold-worker": "0.20.14", - "@bitbybit-dev/occt-worker": "0.20.14", + "@bitbybit-dev/base": "0.21.0", + "@bitbybit-dev/jscad-worker": "0.21.0", + "@bitbybit-dev/manifold-worker": "0.21.0", + "@bitbybit-dev/occt-worker": "0.21.0", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "node_modules/@bitbybit-dev/jscad": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.14.tgz", - "integrity": "sha512-14paqSiCmYRkJxnaaSsY0X89Y9gi8NlWw/PCjtwh0Ds32W4pMbmee2i78ygVnds19qL4Gd1wje5UukVHqPVQTA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.21.0.tgz", + "integrity": "sha512-Q7eE2ILrJRstW4L1711aJZdpwPf1kuhZJqB+KLkkBLsneRsGsh82lBcCbVYAOMuF/q8Lnd4JHxPiIG/m+LYmPQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14", + "@bitbybit-dev/base": "0.21.0", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -2434,50 +2434,51 @@ } }, "node_modules/@bitbybit-dev/jscad-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.14.tgz", - "integrity": "sha512-clF2kTptnZxMS2fWR+sjmnSiQ3OGF8mJYpsL4TqBdiewoIMR2IVmSoKunb0TzAucNdwsecc67gFv8OrXvW8ccA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.21.0.tgz", + "integrity": "sha512-nIvd7GH5Gg51u6PmFXOADXVYTIvixTkNf0YapS1uix7D2JS9Mx10Z4wHAeRKzvJxUAAbEPPRFNkakE22HFGtLQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/jscad": "0.20.14", + "@bitbybit-dev/jscad": "0.21.0", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/manifold": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.14.tgz", - "integrity": "sha512-Cpe3P+LblDOIiyjCsMi/fAwlyOi7AGbhAoZMgGP7ItIKqf11yXXCSRTGF2daXYSPoUht1d86wLZdjProXyAOtQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.21.0.tgz", + "integrity": "sha512-DPpwK9ESB+auDeAbzXcfWRVEzWoMDkpkjc+/uwh+zuSiHSx92PSkzx1/LVTbQCsK+aOfOOy03HQCF5Bu2KQYtw==", "license": "MIT", "dependencies": { + "@bitbybit-dev/base": "0.21.0", "manifold-3d": "3.3.2" } }, "node_modules/@bitbybit-dev/manifold-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.14.tgz", - "integrity": "sha512-o4yAo0BlxWRbv2vsg3G76QodkG3TOzMe7mWGvxeMJNvUrZTV01i9oDCOZudS9pU5lXMeSMpzRE56vbEInL8BqQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.21.0.tgz", + "integrity": "sha512-6Cqv3BP+uI8mHKHI6Jx9TzCxRg1/kMHhCe18+B3KD/rTl9B5mnScCKRBnDansR3bH7aYZGnIw9PmiFnWLkQWEQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/manifold": "0.20.14", + "@bitbybit-dev/manifold": "0.21.0", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/occt": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.14.tgz", - "integrity": "sha512-f915HUNZd345OHbvxzNm+qOudDJ92akrUCUZooYLPSdSuDubNrXPan+ZwNofB1IACHuyCF/sheNc5t6zuEiy0A==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.21.0.tgz", + "integrity": "sha512-vPu3NmF1kBZMOkOdysolGfFxEEnwdHNGORoX3eWbMWT2JL/Tag5Q2CAc5jwa2VvZnS1nE/9x+DVlFQSo8LQnIg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14" + "@bitbybit-dev/base": "0.21.0" } }, "node_modules/@bitbybit-dev/occt-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.14.tgz", - "integrity": "sha512-0AmcXulDOikH/3cs64fbedZwZ+CgxJ6OyZvlPRUHyLXMPSmExMBh3QkImGOE+APL91QNKwBlWdDW/30IBtMQXQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.21.0.tgz", + "integrity": "sha512-xG1sgo6q/RdVA8AgG72wPe4qxcQlrO1V7/Ksn6MqIhZVTsJcm5RbVYlK+nziIWhvlMc1sKE0GNQFcPdALISLuQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/occt": "0.20.14", + "@bitbybit-dev/occt": "0.21.0", "rxjs": "7.5.5" } }, @@ -2527,9 +2528,9 @@ } }, "node_modules/@emnapi/runtime": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz", - "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz", + "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==", "license": "MIT", "optional": true, "dependencies": { @@ -2550,24 +2551,24 @@ "dev": true }, "node_modules/@gltf-transform/core": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.2.1.tgz", - "integrity": "sha512-qKhrQ29KJ9K6sz7xGoGRllqPBlROjPJMQPvCLBOfgMPH3S/Ph5E0e6fD5WmwTY5QPyBsDMRqKd1Vl0ncThTXGw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.3.0.tgz", + "integrity": "sha512-ZeaQfszGJ9LYwELszu45CuDQCsE26lJNNe36FVmN8xclaT6WDdCj7fwGpQXo0/l/YgAVAHX+uO7YNBW75/SRYw==", "license": "MIT", "dependencies": { - "property-graph": "^3.0.0" + "property-graph": "^4.0.0" }, "funding": { "url": "https://github.com/sponsors/donmccurdy" } }, "node_modules/@gltf-transform/extensions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.2.1.tgz", - "integrity": "sha512-ieHSJU9qvb3ucWDxgHFcff+C7fLtFPa6G0Wtc/ki7GsN6Rh7o9eoyqi7Ggj2LO4i3ynCwLLPb/onbJKw2fBtsA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.3.0.tgz", + "integrity": "sha512-XDAjQPYVMHa/VDpSbfCBwI+/1muwRJCaXhUpLgnUzAjn0D//PgvIAcbNm1EwBl3LIWBSwjDUCn2LiMAjp+aXVw==", "license": "MIT", "dependencies": { - "@gltf-transform/core": "^4.2.1", + "@gltf-transform/core": "^4.3.0", "ktx-parse": "^1.0.1" }, "funding": { @@ -2575,13 +2576,13 @@ } }, "node_modules/@gltf-transform/functions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.2.1.tgz", - "integrity": "sha512-hFCI80N6zt7yHlqXbzlYEYQbFwK+2OOZNvacrRtrWiCWKI0k1Ad5+nZFsmuIZZV03aXb5XG6UF7JINT3wETS1Q==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.3.0.tgz", + "integrity": "sha512-FZggHVgt3DHOezgESBrf2vDzuD2FYQYaNT2sT/aP316SIwhuiIwby3z7rhV9joDvWqqUaPkf1UmkjlOaY9riSQ==", "license": "MIT", "dependencies": { - "@gltf-transform/core": "^4.2.1", - "@gltf-transform/extensions": "^4.2.1", + "@gltf-transform/core": "^4.3.0", + "@gltf-transform/extensions": "^4.3.0", "ktx-parse": "^1.0.1", "ndarray": "^1.0.19", "ndarray-lanczos": "^0.3.0", @@ -4224,9 +4225,9 @@ } }, "node_modules/babylonjs-gltf2interface": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.42.0.tgz", - "integrity": "sha512-PYYMVNATzo3yEesPh9b9tgp0/r3O6AXcBA6vc886Pk+XWYW9xiYwTe3B6pwJVsd/Zd12t2SBhDyBpWBqK8w8sw==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.44.1.tgz", + "integrity": "sha512-+z0P0wms1FD5xuVpuRJ1qjvGAbPAWhEWGBWENRPD0Hbz6nd9cnL28/pjxgk39/QhlIuJKL9JZ0o8G0JgLHEnRQ==", "license": "Apache-2.0", "peer": true }, @@ -10551,9 +10552,9 @@ } }, "node_modules/property-graph": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-3.0.0.tgz", - "integrity": "sha512-TnzxUsttmGtw+OiU0LDw+0FlMbJ8vV8pOjyDI7+Kdni4Tj0hW5BFh7TatQu7Y68hcvvFmiFOHilKShsA4R82fA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-4.0.0.tgz", + "integrity": "sha512-I0hojAJfTbSCZy3y6xyK29eayxo14v1bj1VPiDkHjTdz33SV6RdfMz2AHnf4ai62Vng2mN5GkaKahkooBIo9gA==", "license": "MIT" }, "node_modules/proxy-addr": { @@ -14468,14 +14469,14 @@ } }, "@babylonjs/core": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.42.0.tgz", - "integrity": "sha512-Jg8bJrTW4XgcB8tssIkvW8/M2uoVcbH662cYSn2/e5jim5SVbeS3hdbtk9t56s5MJnfJoOQgkz3+hFtWjM3Tmg==" + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.44.1.tgz", + "integrity": "sha512-sF2WWK2d7lg18ESOCxUoRG4d1SzCWz42asjRjRGxZ8r3D7w9ZM3H2wftJIqwaZvD3zWr+wmCVKpQ6hWkboHIXw==" }, "@babylonjs/gui": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.42.0.tgz", - "integrity": "sha512-Ayp0AhAKtPUDXrMFmgtP+PcQTQIlTkQfe20dXFakchSBBHvmoqNiBSwN7rN40XlJPps3pOaDuZsDoboJWkJxCQ==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.44.1.tgz", + "integrity": "sha512-6STDK+Hr8GpY29YMLKnTVhEnWw1NKPrIpz+MqgWuoAAmmpiFtNCr0nnAnCj5fhgGf25L89jy51ogXyg3jfiuDA==", "requires": {} }, "@babylonjs/havok": { @@ -14487,63 +14488,63 @@ } }, "@babylonjs/loaders": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.42.0.tgz", - "integrity": "sha512-sDthqDlgU7Nn4J/TcWFwsh8+ZJqp/tQtexLYlyDxs0VXInSwu9Hm1oCCCuKAdU/e9t4Qr5+ZpfnTDa4s0PcqBA==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.44.1.tgz", + "integrity": "sha512-h5rUGCwhdWv3Hq48DP8sy4/+3QUYjOprxu2i6zXKb69LHMnYE0tZ1xQHBJEOUF60hxA+TwhzdjC8bxInKoeojA==", "requires": {} }, "@babylonjs/materials": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.42.0.tgz", - "integrity": "sha512-fZsc+HWDlh4qrSeC2vfjmki4854V1o9NNIQvukZhkEoT8FsHqMaUUDn6EFRjrA1TBn4SU14uxTOPWrEGvMT/ag==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.44.1.tgz", + "integrity": "sha512-FD0S/aA68oEjKCSNY5ydGkiHbsyo08KlhQ+6R8swtJhx5aq7ojWBt3P9KC78+wjZiCJW37176CIObcV8QcjMAQ==", "requires": {} }, "@babylonjs/serializers": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.42.0.tgz", - "integrity": "sha512-VptrGNtGHn+hqpeev/ozJsPBrAn35s76rNZIdrmrLHIEJIWSo30IgNy4oZRNITcwqJ0H5Bv2r8QqBYZzQifPOg==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.44.1.tgz", + "integrity": "sha512-3FRRdKpHr2qTkALHEvq0ih0P59iTINUFrGZWFUfO3Wu24UBSuTxY9Kq820dvUUWaRtWkXEnMSQbR+5glzcfqBw==", "requires": {} }, "@bitbybit-dev/babylonjs": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.14.tgz", - "integrity": "sha512-5V0HlvP8IZoTMSIaaafobWmFHnwf/nXKkQF2fvDNtw2urLFUJV08SVz8FggAjQTKZHNbmDp69ovJqQmEes7+HQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.21.0.tgz", + "integrity": "sha512-8aPJ+XTXzcnO4bXfmW34lTnVCzC6Hy6TMkh7/ziQSoUsjPp7e7LFHoBBfqCk09LdTLa85gb5x/f6WNAn306Odg==", "requires": { - "@babylonjs/core": "8.42.0", - "@babylonjs/gui": "8.42.0", + "@babylonjs/core": "8.44.1", + "@babylonjs/gui": "8.44.1", "@babylonjs/havok": "1.3.10", - "@babylonjs/loaders": "8.42.0", - "@babylonjs/materials": "8.42.0", - "@babylonjs/serializers": "8.42.0", - "@bitbybit-dev/core": "0.20.14", + "@babylonjs/loaders": "8.44.1", + "@babylonjs/materials": "8.44.1", + "@babylonjs/serializers": "8.44.1", + "@bitbybit-dev/core": "0.21.0", "earcut": "2.2.3" } }, "@bitbybit-dev/base": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.14.tgz", - "integrity": "sha512-Nv8eEwoVDU0Ug3TJIyzPtvIX03whvVIWsUw0xTkImFISUWmU0v1rNSaEd9FL9Rx7rMt2MC9Cxs3lXLkhZS3iAQ==" + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.21.0.tgz", + "integrity": "sha512-dNfsf2tu3/QUD1mvZzzTze8RwHyK2Jrt+Ary8EDKdNKMw+abtCpQYNerdrg0ZQPxvwu/OOQz6N1xCsCwsPkQJg==" }, "@bitbybit-dev/core": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.14.tgz", - "integrity": "sha512-meYYY5SEfoT+NEiM2W2lpwBWtFZzvRzrTcOuzDn/uNgmzyIqUARGYZroQgGEG9XmGiCUEfeYDc7Q7ML2aesyxg==", - "requires": { - "@bitbybit-dev/base": "0.20.14", - "@bitbybit-dev/jscad-worker": "0.20.14", - "@bitbybit-dev/manifold-worker": "0.20.14", - "@bitbybit-dev/occt-worker": "0.20.14", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.21.0.tgz", + "integrity": "sha512-IbeQ8ROreu0/RkkngUE+Eb19ecvqKOWhGefXvIqQmplxt3zEc0FI4Kw8wR3vYl2XMannuVt1xAIYtqqH0tjBzg==", + "requires": { + "@bitbybit-dev/base": "0.21.0", + "@bitbybit-dev/jscad-worker": "0.21.0", + "@bitbybit-dev/manifold-worker": "0.21.0", + "@bitbybit-dev/occt-worker": "0.21.0", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "@bitbybit-dev/jscad": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.14.tgz", - "integrity": "sha512-14paqSiCmYRkJxnaaSsY0X89Y9gi8NlWw/PCjtwh0Ds32W4pMbmee2i78ygVnds19qL4Gd1wje5UukVHqPVQTA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.21.0.tgz", + "integrity": "sha512-Q7eE2ILrJRstW4L1711aJZdpwPf1kuhZJqB+KLkkBLsneRsGsh82lBcCbVYAOMuF/q8Lnd4JHxPiIG/m+LYmPQ==", "requires": { - "@bitbybit-dev/base": "0.20.14", + "@bitbybit-dev/base": "0.21.0", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -14552,45 +14553,46 @@ } }, "@bitbybit-dev/jscad-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.14.tgz", - "integrity": "sha512-clF2kTptnZxMS2fWR+sjmnSiQ3OGF8mJYpsL4TqBdiewoIMR2IVmSoKunb0TzAucNdwsecc67gFv8OrXvW8ccA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.21.0.tgz", + "integrity": "sha512-nIvd7GH5Gg51u6PmFXOADXVYTIvixTkNf0YapS1uix7D2JS9Mx10Z4wHAeRKzvJxUAAbEPPRFNkakE22HFGtLQ==", "requires": { - "@bitbybit-dev/jscad": "0.20.14", + "@bitbybit-dev/jscad": "0.21.0", "rxjs": "7.5.5" } }, "@bitbybit-dev/manifold": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.14.tgz", - "integrity": "sha512-Cpe3P+LblDOIiyjCsMi/fAwlyOi7AGbhAoZMgGP7ItIKqf11yXXCSRTGF2daXYSPoUht1d86wLZdjProXyAOtQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.21.0.tgz", + "integrity": "sha512-DPpwK9ESB+auDeAbzXcfWRVEzWoMDkpkjc+/uwh+zuSiHSx92PSkzx1/LVTbQCsK+aOfOOy03HQCF5Bu2KQYtw==", "requires": { + "@bitbybit-dev/base": "0.21.0", "manifold-3d": "3.3.2" } }, "@bitbybit-dev/manifold-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.14.tgz", - "integrity": "sha512-o4yAo0BlxWRbv2vsg3G76QodkG3TOzMe7mWGvxeMJNvUrZTV01i9oDCOZudS9pU5lXMeSMpzRE56vbEInL8BqQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.21.0.tgz", + "integrity": "sha512-6Cqv3BP+uI8mHKHI6Jx9TzCxRg1/kMHhCe18+B3KD/rTl9B5mnScCKRBnDansR3bH7aYZGnIw9PmiFnWLkQWEQ==", "requires": { - "@bitbybit-dev/manifold": "0.20.14", + "@bitbybit-dev/manifold": "0.21.0", "rxjs": "7.5.5" } }, "@bitbybit-dev/occt": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.14.tgz", - "integrity": "sha512-f915HUNZd345OHbvxzNm+qOudDJ92akrUCUZooYLPSdSuDubNrXPan+ZwNofB1IACHuyCF/sheNc5t6zuEiy0A==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.21.0.tgz", + "integrity": "sha512-vPu3NmF1kBZMOkOdysolGfFxEEnwdHNGORoX3eWbMWT2JL/Tag5Q2CAc5jwa2VvZnS1nE/9x+DVlFQSo8LQnIg==", "requires": { - "@bitbybit-dev/base": "0.20.14" + "@bitbybit-dev/base": "0.21.0" } }, "@bitbybit-dev/occt-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.14.tgz", - "integrity": "sha512-0AmcXulDOikH/3cs64fbedZwZ+CgxJ6OyZvlPRUHyLXMPSmExMBh3QkImGOE+APL91QNKwBlWdDW/30IBtMQXQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.21.0.tgz", + "integrity": "sha512-xG1sgo6q/RdVA8AgG72wPe4qxcQlrO1V7/Ksn6MqIhZVTsJcm5RbVYlK+nziIWhvlMc1sKE0GNQFcPdALISLuQ==", "requires": { - "@bitbybit-dev/occt": "0.20.14", + "@bitbybit-dev/occt": "0.21.0", "rxjs": "7.5.5" } }, @@ -14625,9 +14627,9 @@ "dev": true }, "@emnapi/runtime": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz", - "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz", + "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==", "optional": true, "requires": { "tslib": "^2.4.0" @@ -14648,29 +14650,29 @@ "dev": true }, "@gltf-transform/core": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.2.1.tgz", - "integrity": "sha512-qKhrQ29KJ9K6sz7xGoGRllqPBlROjPJMQPvCLBOfgMPH3S/Ph5E0e6fD5WmwTY5QPyBsDMRqKd1Vl0ncThTXGw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.3.0.tgz", + "integrity": "sha512-ZeaQfszGJ9LYwELszu45CuDQCsE26lJNNe36FVmN8xclaT6WDdCj7fwGpQXo0/l/YgAVAHX+uO7YNBW75/SRYw==", "requires": { - "property-graph": "^3.0.0" + "property-graph": "^4.0.0" } }, "@gltf-transform/extensions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.2.1.tgz", - "integrity": "sha512-ieHSJU9qvb3ucWDxgHFcff+C7fLtFPa6G0Wtc/ki7GsN6Rh7o9eoyqi7Ggj2LO4i3ynCwLLPb/onbJKw2fBtsA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.3.0.tgz", + "integrity": "sha512-XDAjQPYVMHa/VDpSbfCBwI+/1muwRJCaXhUpLgnUzAjn0D//PgvIAcbNm1EwBl3LIWBSwjDUCn2LiMAjp+aXVw==", "requires": { - "@gltf-transform/core": "^4.2.1", + "@gltf-transform/core": "^4.3.0", "ktx-parse": "^1.0.1" } }, "@gltf-transform/functions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.2.1.tgz", - "integrity": "sha512-hFCI80N6zt7yHlqXbzlYEYQbFwK+2OOZNvacrRtrWiCWKI0k1Ad5+nZFsmuIZZV03aXb5XG6UF7JINT3wETS1Q==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.3.0.tgz", + "integrity": "sha512-FZggHVgt3DHOezgESBrf2vDzuD2FYQYaNT2sT/aP316SIwhuiIwby3z7rhV9joDvWqqUaPkf1UmkjlOaY9riSQ==", "requires": { - "@gltf-transform/core": "^4.2.1", - "@gltf-transform/extensions": "^4.2.1", + "@gltf-transform/core": "^4.3.0", + "@gltf-transform/extensions": "^4.3.0", "ktx-parse": "^1.0.1", "ndarray": "^1.0.19", "ndarray-lanczos": "^0.3.0", @@ -15832,9 +15834,9 @@ } }, "babylonjs-gltf2interface": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.42.0.tgz", - "integrity": "sha512-PYYMVNATzo3yEesPh9b9tgp0/r3O6AXcBA6vc886Pk+XWYW9xiYwTe3B6pwJVsd/Zd12t2SBhDyBpWBqK8w8sw==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.44.1.tgz", + "integrity": "sha512-+z0P0wms1FD5xuVpuRJ1qjvGAbPAWhEWGBWENRPD0Hbz6nd9cnL28/pjxgk39/QhlIuJKL9JZ0o8G0JgLHEnRQ==", "peer": true }, "balanced-match": { @@ -20463,9 +20465,9 @@ } }, "property-graph": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-3.0.0.tgz", - "integrity": "sha512-TnzxUsttmGtw+OiU0LDw+0FlMbJ8vV8pOjyDI7+Kdni4Tj0hW5BFh7TatQu7Y68hcvvFmiFOHilKShsA4R82fA==" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-4.0.0.tgz", + "integrity": "sha512-I0hojAJfTbSCZy3y6xyK29eayxo14v1bj1VPiDkHjTdz33SV6RdfMz2AHnf4ai62Vng2mN5GkaKahkooBIo9gA==" }, "proxy-addr": { "version": "2.0.7", diff --git a/examples/angular/babylonjs/laptop-holder/package.json b/examples/angular/babylonjs/laptop-holder/package.json index 03f1d0be..9f8dd5ff 100644 --- a/examples/angular/babylonjs/laptop-holder/package.json +++ b/examples/angular/babylonjs/laptop-holder/package.json @@ -10,7 +10,7 @@ }, "private": true, "dependencies": { - "@bitbybit-dev/babylonjs": "0.20.14", + "@bitbybit-dev/babylonjs": "0.21.0", "@angular/animations": "13.3.0", "@angular/common": "13.3.0", "@angular/compiler": "13.3.0", diff --git a/examples/angular/threejs/simple/package-lock.json b/examples/angular/threejs/simple/package-lock.json index fca49b2e..cbee6b1a 100644 --- a/examples/angular/threejs/simple/package-lock.json +++ b/examples/angular/threejs/simple/package-lock.json @@ -17,7 +17,7 @@ "@angular/platform-browser": "13.3.0", "@angular/platform-browser-dynamic": "13.3.0", "@angular/router": "13.3.0", - "@bitbybit-dev/threejs": "0.20.14", + "@bitbybit-dev/threejs": "0.21.0", "rxjs": "7.5.5", "tslib": "2.3.1", "zone.js": "0.11.5" @@ -2331,33 +2331,33 @@ } }, "node_modules/@bitbybit-dev/base": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.14.tgz", - "integrity": "sha512-Nv8eEwoVDU0Ug3TJIyzPtvIX03whvVIWsUw0xTkImFISUWmU0v1rNSaEd9FL9Rx7rMt2MC9Cxs3lXLkhZS3iAQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.21.0.tgz", + "integrity": "sha512-dNfsf2tu3/QUD1mvZzzTze8RwHyK2Jrt+Ary8EDKdNKMw+abtCpQYNerdrg0ZQPxvwu/OOQz6N1xCsCwsPkQJg==", "license": "MIT" }, "node_modules/@bitbybit-dev/core": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.14.tgz", - "integrity": "sha512-meYYY5SEfoT+NEiM2W2lpwBWtFZzvRzrTcOuzDn/uNgmzyIqUARGYZroQgGEG9XmGiCUEfeYDc7Q7ML2aesyxg==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.21.0.tgz", + "integrity": "sha512-IbeQ8ROreu0/RkkngUE+Eb19ecvqKOWhGefXvIqQmplxt3zEc0FI4Kw8wR3vYl2XMannuVt1xAIYtqqH0tjBzg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14", - "@bitbybit-dev/jscad-worker": "0.20.14", - "@bitbybit-dev/manifold-worker": "0.20.14", - "@bitbybit-dev/occt-worker": "0.20.14", + "@bitbybit-dev/base": "0.21.0", + "@bitbybit-dev/jscad-worker": "0.21.0", + "@bitbybit-dev/manifold-worker": "0.21.0", + "@bitbybit-dev/occt-worker": "0.21.0", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "node_modules/@bitbybit-dev/jscad": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.14.tgz", - "integrity": "sha512-14paqSiCmYRkJxnaaSsY0X89Y9gi8NlWw/PCjtwh0Ds32W4pMbmee2i78ygVnds19qL4Gd1wje5UukVHqPVQTA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.21.0.tgz", + "integrity": "sha512-Q7eE2ILrJRstW4L1711aJZdpwPf1kuhZJqB+KLkkBLsneRsGsh82lBcCbVYAOMuF/q8Lnd4JHxPiIG/m+LYmPQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14", + "@bitbybit-dev/base": "0.21.0", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -2366,60 +2366,61 @@ } }, "node_modules/@bitbybit-dev/jscad-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.14.tgz", - "integrity": "sha512-clF2kTptnZxMS2fWR+sjmnSiQ3OGF8mJYpsL4TqBdiewoIMR2IVmSoKunb0TzAucNdwsecc67gFv8OrXvW8ccA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.21.0.tgz", + "integrity": "sha512-nIvd7GH5Gg51u6PmFXOADXVYTIvixTkNf0YapS1uix7D2JS9Mx10Z4wHAeRKzvJxUAAbEPPRFNkakE22HFGtLQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/jscad": "0.20.14", + "@bitbybit-dev/jscad": "0.21.0", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/manifold": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.14.tgz", - "integrity": "sha512-Cpe3P+LblDOIiyjCsMi/fAwlyOi7AGbhAoZMgGP7ItIKqf11yXXCSRTGF2daXYSPoUht1d86wLZdjProXyAOtQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.21.0.tgz", + "integrity": "sha512-DPpwK9ESB+auDeAbzXcfWRVEzWoMDkpkjc+/uwh+zuSiHSx92PSkzx1/LVTbQCsK+aOfOOy03HQCF5Bu2KQYtw==", "license": "MIT", "dependencies": { + "@bitbybit-dev/base": "0.21.0", "manifold-3d": "3.3.2" } }, "node_modules/@bitbybit-dev/manifold-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.14.tgz", - "integrity": "sha512-o4yAo0BlxWRbv2vsg3G76QodkG3TOzMe7mWGvxeMJNvUrZTV01i9oDCOZudS9pU5lXMeSMpzRE56vbEInL8BqQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.21.0.tgz", + "integrity": "sha512-6Cqv3BP+uI8mHKHI6Jx9TzCxRg1/kMHhCe18+B3KD/rTl9B5mnScCKRBnDansR3bH7aYZGnIw9PmiFnWLkQWEQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/manifold": "0.20.14", + "@bitbybit-dev/manifold": "0.21.0", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/occt": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.14.tgz", - "integrity": "sha512-f915HUNZd345OHbvxzNm+qOudDJ92akrUCUZooYLPSdSuDubNrXPan+ZwNofB1IACHuyCF/sheNc5t6zuEiy0A==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.21.0.tgz", + "integrity": "sha512-vPu3NmF1kBZMOkOdysolGfFxEEnwdHNGORoX3eWbMWT2JL/Tag5Q2CAc5jwa2VvZnS1nE/9x+DVlFQSo8LQnIg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14" + "@bitbybit-dev/base": "0.21.0" } }, "node_modules/@bitbybit-dev/occt-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.14.tgz", - "integrity": "sha512-0AmcXulDOikH/3cs64fbedZwZ+CgxJ6OyZvlPRUHyLXMPSmExMBh3QkImGOE+APL91QNKwBlWdDW/30IBtMQXQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.21.0.tgz", + "integrity": "sha512-xG1sgo6q/RdVA8AgG72wPe4qxcQlrO1V7/Ksn6MqIhZVTsJcm5RbVYlK+nziIWhvlMc1sKE0GNQFcPdALISLuQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/occt": "0.20.14", + "@bitbybit-dev/occt": "0.21.0", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/threejs": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/threejs/-/threejs-0.20.14.tgz", - "integrity": "sha512-2vb552Yoz0QM+R268k5F7SwZrzV8JQb71xxkzxqwl3VmvZl2yFQJBDUpeiIQF2N5iyKfgIuiM7LXzZYdCaY4PQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/threejs/-/threejs-0.21.0.tgz", + "integrity": "sha512-p0fHuLTjoXs3UIWoC2TFUBAhu0F4sTPU//PCvwwPLmLrbrVmpEFV61tGs0739hbU4eKS5goCTUM99RfjbRxW6A==", "license": "MIT", "dependencies": { - "@bitbybit-dev/core": "0.20.14", + "@bitbybit-dev/core": "0.21.0", "three": "0.182.0" } }, @@ -2469,9 +2470,9 @@ } }, "node_modules/@emnapi/runtime": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz", - "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz", + "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==", "license": "MIT", "optional": true, "dependencies": { @@ -2492,24 +2493,24 @@ "dev": true }, "node_modules/@gltf-transform/core": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.2.1.tgz", - "integrity": "sha512-qKhrQ29KJ9K6sz7xGoGRllqPBlROjPJMQPvCLBOfgMPH3S/Ph5E0e6fD5WmwTY5QPyBsDMRqKd1Vl0ncThTXGw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.3.0.tgz", + "integrity": "sha512-ZeaQfszGJ9LYwELszu45CuDQCsE26lJNNe36FVmN8xclaT6WDdCj7fwGpQXo0/l/YgAVAHX+uO7YNBW75/SRYw==", "license": "MIT", "dependencies": { - "property-graph": "^3.0.0" + "property-graph": "^4.0.0" }, "funding": { "url": "https://github.com/sponsors/donmccurdy" } }, "node_modules/@gltf-transform/extensions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.2.1.tgz", - "integrity": "sha512-ieHSJU9qvb3ucWDxgHFcff+C7fLtFPa6G0Wtc/ki7GsN6Rh7o9eoyqi7Ggj2LO4i3ynCwLLPb/onbJKw2fBtsA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.3.0.tgz", + "integrity": "sha512-XDAjQPYVMHa/VDpSbfCBwI+/1muwRJCaXhUpLgnUzAjn0D//PgvIAcbNm1EwBl3LIWBSwjDUCn2LiMAjp+aXVw==", "license": "MIT", "dependencies": { - "@gltf-transform/core": "^4.2.1", + "@gltf-transform/core": "^4.3.0", "ktx-parse": "^1.0.1" }, "funding": { @@ -2517,13 +2518,13 @@ } }, "node_modules/@gltf-transform/functions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.2.1.tgz", - "integrity": "sha512-hFCI80N6zt7yHlqXbzlYEYQbFwK+2OOZNvacrRtrWiCWKI0k1Ad5+nZFsmuIZZV03aXb5XG6UF7JINT3wETS1Q==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.3.0.tgz", + "integrity": "sha512-FZggHVgt3DHOezgESBrf2vDzuD2FYQYaNT2sT/aP316SIwhuiIwby3z7rhV9joDvWqqUaPkf1UmkjlOaY9riSQ==", "license": "MIT", "dependencies": { - "@gltf-transform/core": "^4.2.1", - "@gltf-transform/extensions": "^4.2.1", + "@gltf-transform/core": "^4.3.0", + "@gltf-transform/extensions": "^4.3.0", "ktx-parse": "^1.0.1", "ndarray": "^1.0.19", "ndarray-lanczos": "^0.3.0", @@ -10476,9 +10477,9 @@ } }, "node_modules/property-graph": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-3.0.0.tgz", - "integrity": "sha512-TnzxUsttmGtw+OiU0LDw+0FlMbJ8vV8pOjyDI7+Kdni4Tj0hW5BFh7TatQu7Y68hcvvFmiFOHilKShsA4R82fA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-4.0.0.tgz", + "integrity": "sha512-I0hojAJfTbSCZy3y6xyK29eayxo14v1bj1VPiDkHjTdz33SV6RdfMz2AHnf4ai62Vng2mN5GkaKahkooBIo9gA==", "license": "MIT" }, "node_modules/proxy-addr": { @@ -14399,30 +14400,30 @@ } }, "@bitbybit-dev/base": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.14.tgz", - "integrity": "sha512-Nv8eEwoVDU0Ug3TJIyzPtvIX03whvVIWsUw0xTkImFISUWmU0v1rNSaEd9FL9Rx7rMt2MC9Cxs3lXLkhZS3iAQ==" + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.21.0.tgz", + "integrity": "sha512-dNfsf2tu3/QUD1mvZzzTze8RwHyK2Jrt+Ary8EDKdNKMw+abtCpQYNerdrg0ZQPxvwu/OOQz6N1xCsCwsPkQJg==" }, "@bitbybit-dev/core": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.14.tgz", - "integrity": "sha512-meYYY5SEfoT+NEiM2W2lpwBWtFZzvRzrTcOuzDn/uNgmzyIqUARGYZroQgGEG9XmGiCUEfeYDc7Q7ML2aesyxg==", - "requires": { - "@bitbybit-dev/base": "0.20.14", - "@bitbybit-dev/jscad-worker": "0.20.14", - "@bitbybit-dev/manifold-worker": "0.20.14", - "@bitbybit-dev/occt-worker": "0.20.14", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.21.0.tgz", + "integrity": "sha512-IbeQ8ROreu0/RkkngUE+Eb19ecvqKOWhGefXvIqQmplxt3zEc0FI4Kw8wR3vYl2XMannuVt1xAIYtqqH0tjBzg==", + "requires": { + "@bitbybit-dev/base": "0.21.0", + "@bitbybit-dev/jscad-worker": "0.21.0", + "@bitbybit-dev/manifold-worker": "0.21.0", + "@bitbybit-dev/occt-worker": "0.21.0", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "@bitbybit-dev/jscad": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.14.tgz", - "integrity": "sha512-14paqSiCmYRkJxnaaSsY0X89Y9gi8NlWw/PCjtwh0Ds32W4pMbmee2i78ygVnds19qL4Gd1wje5UukVHqPVQTA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.21.0.tgz", + "integrity": "sha512-Q7eE2ILrJRstW4L1711aJZdpwPf1kuhZJqB+KLkkBLsneRsGsh82lBcCbVYAOMuF/q8Lnd4JHxPiIG/m+LYmPQ==", "requires": { - "@bitbybit-dev/base": "0.20.14", + "@bitbybit-dev/base": "0.21.0", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -14431,54 +14432,55 @@ } }, "@bitbybit-dev/jscad-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.14.tgz", - "integrity": "sha512-clF2kTptnZxMS2fWR+sjmnSiQ3OGF8mJYpsL4TqBdiewoIMR2IVmSoKunb0TzAucNdwsecc67gFv8OrXvW8ccA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.21.0.tgz", + "integrity": "sha512-nIvd7GH5Gg51u6PmFXOADXVYTIvixTkNf0YapS1uix7D2JS9Mx10Z4wHAeRKzvJxUAAbEPPRFNkakE22HFGtLQ==", "requires": { - "@bitbybit-dev/jscad": "0.20.14", + "@bitbybit-dev/jscad": "0.21.0", "rxjs": "7.5.5" } }, "@bitbybit-dev/manifold": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.14.tgz", - "integrity": "sha512-Cpe3P+LblDOIiyjCsMi/fAwlyOi7AGbhAoZMgGP7ItIKqf11yXXCSRTGF2daXYSPoUht1d86wLZdjProXyAOtQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.21.0.tgz", + "integrity": "sha512-DPpwK9ESB+auDeAbzXcfWRVEzWoMDkpkjc+/uwh+zuSiHSx92PSkzx1/LVTbQCsK+aOfOOy03HQCF5Bu2KQYtw==", "requires": { + "@bitbybit-dev/base": "0.21.0", "manifold-3d": "3.3.2" } }, "@bitbybit-dev/manifold-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.14.tgz", - "integrity": "sha512-o4yAo0BlxWRbv2vsg3G76QodkG3TOzMe7mWGvxeMJNvUrZTV01i9oDCOZudS9pU5lXMeSMpzRE56vbEInL8BqQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.21.0.tgz", + "integrity": "sha512-6Cqv3BP+uI8mHKHI6Jx9TzCxRg1/kMHhCe18+B3KD/rTl9B5mnScCKRBnDansR3bH7aYZGnIw9PmiFnWLkQWEQ==", "requires": { - "@bitbybit-dev/manifold": "0.20.14", + "@bitbybit-dev/manifold": "0.21.0", "rxjs": "7.5.5" } }, "@bitbybit-dev/occt": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.14.tgz", - "integrity": "sha512-f915HUNZd345OHbvxzNm+qOudDJ92akrUCUZooYLPSdSuDubNrXPan+ZwNofB1IACHuyCF/sheNc5t6zuEiy0A==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.21.0.tgz", + "integrity": "sha512-vPu3NmF1kBZMOkOdysolGfFxEEnwdHNGORoX3eWbMWT2JL/Tag5Q2CAc5jwa2VvZnS1nE/9x+DVlFQSo8LQnIg==", "requires": { - "@bitbybit-dev/base": "0.20.14" + "@bitbybit-dev/base": "0.21.0" } }, "@bitbybit-dev/occt-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.14.tgz", - "integrity": "sha512-0AmcXulDOikH/3cs64fbedZwZ+CgxJ6OyZvlPRUHyLXMPSmExMBh3QkImGOE+APL91QNKwBlWdDW/30IBtMQXQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.21.0.tgz", + "integrity": "sha512-xG1sgo6q/RdVA8AgG72wPe4qxcQlrO1V7/Ksn6MqIhZVTsJcm5RbVYlK+nziIWhvlMc1sKE0GNQFcPdALISLuQ==", "requires": { - "@bitbybit-dev/occt": "0.20.14", + "@bitbybit-dev/occt": "0.21.0", "rxjs": "7.5.5" } }, "@bitbybit-dev/threejs": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/threejs/-/threejs-0.20.14.tgz", - "integrity": "sha512-2vb552Yoz0QM+R268k5F7SwZrzV8JQb71xxkzxqwl3VmvZl2yFQJBDUpeiIQF2N5iyKfgIuiM7LXzZYdCaY4PQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/threejs/-/threejs-0.21.0.tgz", + "integrity": "sha512-p0fHuLTjoXs3UIWoC2TFUBAhu0F4sTPU//PCvwwPLmLrbrVmpEFV61tGs0739hbU4eKS5goCTUM99RfjbRxW6A==", "requires": { - "@bitbybit-dev/core": "0.20.14", + "@bitbybit-dev/core": "0.21.0", "three": "0.182.0" } }, @@ -14513,9 +14515,9 @@ "dev": true }, "@emnapi/runtime": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz", - "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz", + "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==", "optional": true, "requires": { "tslib": "^2.4.0" @@ -14536,29 +14538,29 @@ "dev": true }, "@gltf-transform/core": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.2.1.tgz", - "integrity": "sha512-qKhrQ29KJ9K6sz7xGoGRllqPBlROjPJMQPvCLBOfgMPH3S/Ph5E0e6fD5WmwTY5QPyBsDMRqKd1Vl0ncThTXGw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.3.0.tgz", + "integrity": "sha512-ZeaQfszGJ9LYwELszu45CuDQCsE26lJNNe36FVmN8xclaT6WDdCj7fwGpQXo0/l/YgAVAHX+uO7YNBW75/SRYw==", "requires": { - "property-graph": "^3.0.0" + "property-graph": "^4.0.0" } }, "@gltf-transform/extensions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.2.1.tgz", - "integrity": "sha512-ieHSJU9qvb3ucWDxgHFcff+C7fLtFPa6G0Wtc/ki7GsN6Rh7o9eoyqi7Ggj2LO4i3ynCwLLPb/onbJKw2fBtsA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.3.0.tgz", + "integrity": "sha512-XDAjQPYVMHa/VDpSbfCBwI+/1muwRJCaXhUpLgnUzAjn0D//PgvIAcbNm1EwBl3LIWBSwjDUCn2LiMAjp+aXVw==", "requires": { - "@gltf-transform/core": "^4.2.1", + "@gltf-transform/core": "^4.3.0", "ktx-parse": "^1.0.1" } }, "@gltf-transform/functions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.2.1.tgz", - "integrity": "sha512-hFCI80N6zt7yHlqXbzlYEYQbFwK+2OOZNvacrRtrWiCWKI0k1Ad5+nZFsmuIZZV03aXb5XG6UF7JINT3wETS1Q==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.3.0.tgz", + "integrity": "sha512-FZggHVgt3DHOezgESBrf2vDzuD2FYQYaNT2sT/aP316SIwhuiIwby3z7rhV9joDvWqqUaPkf1UmkjlOaY9riSQ==", "requires": { - "@gltf-transform/core": "^4.2.1", - "@gltf-transform/extensions": "^4.2.1", + "@gltf-transform/core": "^4.3.0", + "@gltf-transform/extensions": "^4.3.0", "ktx-parse": "^1.0.1", "ndarray": "^1.0.19", "ndarray-lanczos": "^0.3.0", @@ -20335,9 +20337,9 @@ } }, "property-graph": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-3.0.0.tgz", - "integrity": "sha512-TnzxUsttmGtw+OiU0LDw+0FlMbJ8vV8pOjyDI7+Kdni4Tj0hW5BFh7TatQu7Y68hcvvFmiFOHilKShsA4R82fA==" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-4.0.0.tgz", + "integrity": "sha512-I0hojAJfTbSCZy3y6xyK29eayxo14v1bj1VPiDkHjTdz33SV6RdfMz2AHnf4ai62Vng2mN5GkaKahkooBIo9gA==" }, "proxy-addr": { "version": "2.0.7", diff --git a/examples/angular/threejs/simple/package.json b/examples/angular/threejs/simple/package.json index 46d9d932..b3122257 100644 --- a/examples/angular/threejs/simple/package.json +++ b/examples/angular/threejs/simple/package.json @@ -10,7 +10,7 @@ }, "private": true, "dependencies": { - "@bitbybit-dev/threejs": "0.20.14", + "@bitbybit-dev/threejs": "0.21.0", "@angular/animations": "13.3.0", "@angular/common": "13.3.0", "@angular/compiler": "13.3.0", diff --git a/examples/angular/threejs/vite-basic-example/package-lock.json b/examples/angular/threejs/vite-basic-example/package-lock.json index 82849187..88c4c047 100644 --- a/examples/angular/threejs/vite-basic-example/package-lock.json +++ b/examples/angular/threejs/vite-basic-example/package-lock.json @@ -13,7 +13,7 @@ "@angular/forms": "^20.0.0", "@angular/platform-browser": "^20.0.0", "@angular/router": "^20.0.0", - "@bitbybit-dev/threejs": "0.20.14", + "@bitbybit-dev/threejs": "0.21.0", "rxjs": "7.5.5", "tslib": "^2.5.0", "zone.js": "~0.15.0" @@ -929,33 +929,33 @@ } }, "node_modules/@bitbybit-dev/base": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.14.tgz", - "integrity": "sha512-Nv8eEwoVDU0Ug3TJIyzPtvIX03whvVIWsUw0xTkImFISUWmU0v1rNSaEd9FL9Rx7rMt2MC9Cxs3lXLkhZS3iAQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.21.0.tgz", + "integrity": "sha512-dNfsf2tu3/QUD1mvZzzTze8RwHyK2Jrt+Ary8EDKdNKMw+abtCpQYNerdrg0ZQPxvwu/OOQz6N1xCsCwsPkQJg==", "license": "MIT" }, "node_modules/@bitbybit-dev/core": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.14.tgz", - "integrity": "sha512-meYYY5SEfoT+NEiM2W2lpwBWtFZzvRzrTcOuzDn/uNgmzyIqUARGYZroQgGEG9XmGiCUEfeYDc7Q7ML2aesyxg==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.21.0.tgz", + "integrity": "sha512-IbeQ8ROreu0/RkkngUE+Eb19ecvqKOWhGefXvIqQmplxt3zEc0FI4Kw8wR3vYl2XMannuVt1xAIYtqqH0tjBzg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14", - "@bitbybit-dev/jscad-worker": "0.20.14", - "@bitbybit-dev/manifold-worker": "0.20.14", - "@bitbybit-dev/occt-worker": "0.20.14", + "@bitbybit-dev/base": "0.21.0", + "@bitbybit-dev/jscad-worker": "0.21.0", + "@bitbybit-dev/manifold-worker": "0.21.0", + "@bitbybit-dev/occt-worker": "0.21.0", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "node_modules/@bitbybit-dev/jscad": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.14.tgz", - "integrity": "sha512-14paqSiCmYRkJxnaaSsY0X89Y9gi8NlWw/PCjtwh0Ds32W4pMbmee2i78ygVnds19qL4Gd1wje5UukVHqPVQTA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.21.0.tgz", + "integrity": "sha512-Q7eE2ILrJRstW4L1711aJZdpwPf1kuhZJqB+KLkkBLsneRsGsh82lBcCbVYAOMuF/q8Lnd4JHxPiIG/m+LYmPQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14", + "@bitbybit-dev/base": "0.21.0", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -964,60 +964,61 @@ } }, "node_modules/@bitbybit-dev/jscad-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.14.tgz", - "integrity": "sha512-clF2kTptnZxMS2fWR+sjmnSiQ3OGF8mJYpsL4TqBdiewoIMR2IVmSoKunb0TzAucNdwsecc67gFv8OrXvW8ccA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.21.0.tgz", + "integrity": "sha512-nIvd7GH5Gg51u6PmFXOADXVYTIvixTkNf0YapS1uix7D2JS9Mx10Z4wHAeRKzvJxUAAbEPPRFNkakE22HFGtLQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/jscad": "0.20.14", + "@bitbybit-dev/jscad": "0.21.0", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/manifold": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.14.tgz", - "integrity": "sha512-Cpe3P+LblDOIiyjCsMi/fAwlyOi7AGbhAoZMgGP7ItIKqf11yXXCSRTGF2daXYSPoUht1d86wLZdjProXyAOtQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.21.0.tgz", + "integrity": "sha512-DPpwK9ESB+auDeAbzXcfWRVEzWoMDkpkjc+/uwh+zuSiHSx92PSkzx1/LVTbQCsK+aOfOOy03HQCF5Bu2KQYtw==", "license": "MIT", "dependencies": { + "@bitbybit-dev/base": "0.21.0", "manifold-3d": "3.3.2" } }, "node_modules/@bitbybit-dev/manifold-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.14.tgz", - "integrity": "sha512-o4yAo0BlxWRbv2vsg3G76QodkG3TOzMe7mWGvxeMJNvUrZTV01i9oDCOZudS9pU5lXMeSMpzRE56vbEInL8BqQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.21.0.tgz", + "integrity": "sha512-6Cqv3BP+uI8mHKHI6Jx9TzCxRg1/kMHhCe18+B3KD/rTl9B5mnScCKRBnDansR3bH7aYZGnIw9PmiFnWLkQWEQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/manifold": "0.20.14", + "@bitbybit-dev/manifold": "0.21.0", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/occt": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.14.tgz", - "integrity": "sha512-f915HUNZd345OHbvxzNm+qOudDJ92akrUCUZooYLPSdSuDubNrXPan+ZwNofB1IACHuyCF/sheNc5t6zuEiy0A==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.21.0.tgz", + "integrity": "sha512-vPu3NmF1kBZMOkOdysolGfFxEEnwdHNGORoX3eWbMWT2JL/Tag5Q2CAc5jwa2VvZnS1nE/9x+DVlFQSo8LQnIg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14" + "@bitbybit-dev/base": "0.21.0" } }, "node_modules/@bitbybit-dev/occt-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.14.tgz", - "integrity": "sha512-0AmcXulDOikH/3cs64fbedZwZ+CgxJ6OyZvlPRUHyLXMPSmExMBh3QkImGOE+APL91QNKwBlWdDW/30IBtMQXQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.21.0.tgz", + "integrity": "sha512-xG1sgo6q/RdVA8AgG72wPe4qxcQlrO1V7/Ksn6MqIhZVTsJcm5RbVYlK+nziIWhvlMc1sKE0GNQFcPdALISLuQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/occt": "0.20.14", + "@bitbybit-dev/occt": "0.21.0", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/threejs": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/threejs/-/threejs-0.20.14.tgz", - "integrity": "sha512-2vb552Yoz0QM+R268k5F7SwZrzV8JQb71xxkzxqwl3VmvZl2yFQJBDUpeiIQF2N5iyKfgIuiM7LXzZYdCaY4PQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/threejs/-/threejs-0.21.0.tgz", + "integrity": "sha512-p0fHuLTjoXs3UIWoC2TFUBAhu0F4sTPU//PCvwwPLmLrbrVmpEFV61tGs0739hbU4eKS5goCTUM99RfjbRxW6A==", "license": "MIT", "dependencies": { - "@bitbybit-dev/core": "0.20.14", + "@bitbybit-dev/core": "0.21.0", "three": "0.182.0" } }, @@ -1029,9 +1030,9 @@ "license": "Apache-2.0" }, "node_modules/@emnapi/runtime": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz", - "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz", + "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==", "license": "MIT", "optional": true, "dependencies": { @@ -1481,24 +1482,24 @@ } }, "node_modules/@gltf-transform/core": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.2.1.tgz", - "integrity": "sha512-qKhrQ29KJ9K6sz7xGoGRllqPBlROjPJMQPvCLBOfgMPH3S/Ph5E0e6fD5WmwTY5QPyBsDMRqKd1Vl0ncThTXGw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.3.0.tgz", + "integrity": "sha512-ZeaQfszGJ9LYwELszu45CuDQCsE26lJNNe36FVmN8xclaT6WDdCj7fwGpQXo0/l/YgAVAHX+uO7YNBW75/SRYw==", "license": "MIT", "dependencies": { - "property-graph": "^3.0.0" + "property-graph": "^4.0.0" }, "funding": { "url": "https://github.com/sponsors/donmccurdy" } }, "node_modules/@gltf-transform/extensions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.2.1.tgz", - "integrity": "sha512-ieHSJU9qvb3ucWDxgHFcff+C7fLtFPa6G0Wtc/ki7GsN6Rh7o9eoyqi7Ggj2LO4i3ynCwLLPb/onbJKw2fBtsA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.3.0.tgz", + "integrity": "sha512-XDAjQPYVMHa/VDpSbfCBwI+/1muwRJCaXhUpLgnUzAjn0D//PgvIAcbNm1EwBl3LIWBSwjDUCn2LiMAjp+aXVw==", "license": "MIT", "dependencies": { - "@gltf-transform/core": "^4.2.1", + "@gltf-transform/core": "^4.3.0", "ktx-parse": "^1.0.1" }, "funding": { @@ -1506,13 +1507,13 @@ } }, "node_modules/@gltf-transform/functions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.2.1.tgz", - "integrity": "sha512-hFCI80N6zt7yHlqXbzlYEYQbFwK+2OOZNvacrRtrWiCWKI0k1Ad5+nZFsmuIZZV03aXb5XG6UF7JINT3wETS1Q==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.3.0.tgz", + "integrity": "sha512-FZggHVgt3DHOezgESBrf2vDzuD2FYQYaNT2sT/aP316SIwhuiIwby3z7rhV9joDvWqqUaPkf1UmkjlOaY9riSQ==", "license": "MIT", "dependencies": { - "@gltf-transform/core": "^4.2.1", - "@gltf-transform/extensions": "^4.2.1", + "@gltf-transform/core": "^4.3.0", + "@gltf-transform/extensions": "^4.3.0", "ktx-parse": "^1.0.1", "ndarray": "^1.0.19", "ndarray-lanczos": "^0.3.0", @@ -7597,9 +7598,9 @@ } }, "node_modules/property-graph": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-3.0.0.tgz", - "integrity": "sha512-TnzxUsttmGtw+OiU0LDw+0FlMbJ8vV8pOjyDI7+Kdni4Tj0hW5BFh7TatQu7Y68hcvvFmiFOHilKShsA4R82fA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-4.0.0.tgz", + "integrity": "sha512-I0hojAJfTbSCZy3y6xyK29eayxo14v1bj1VPiDkHjTdz33SV6RdfMz2AHnf4ai62Vng2mN5GkaKahkooBIo9gA==", "license": "MIT" }, "node_modules/proxy-addr": { diff --git a/examples/angular/threejs/vite-basic-example/package.json b/examples/angular/threejs/vite-basic-example/package.json index 0f3cf8fa..06a23538 100644 --- a/examples/angular/threejs/vite-basic-example/package.json +++ b/examples/angular/threejs/vite-basic-example/package.json @@ -14,7 +14,7 @@ "@angular/forms": "^20.0.0", "@angular/platform-browser": "^20.0.0", "@angular/router": "^20.0.0", - "@bitbybit-dev/threejs": "0.20.14", + "@bitbybit-dev/threejs": "0.21.0", "rxjs": "7.5.5", "tslib": "^2.5.0", "zone.js": "~0.15.0" diff --git a/examples/angular/threejs/vite-basic-example/src/workers/manifold.worker.ts b/examples/angular/threejs/vite-basic-example/src/workers/manifold.worker.ts index b25cf736..09625fcb 100644 --- a/examples/angular/threejs/vite-basic-example/src/workers/manifold.worker.ts +++ b/examples/angular/threejs/vite-basic-example/src/workers/manifold.worker.ts @@ -7,7 +7,7 @@ import Module from "manifold-3d"; const init = async () => { const wasm = await Module({ locateFile: () => { - return "https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.20.14/wasm/manifold-3-3-2.wasm"; + return "https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.21.0/wasm/manifold-3-3-2.wasm"; }, }); wasm.setup(); diff --git a/examples/nextjs/babylonjs/simple/package-lock.json b/examples/nextjs/babylonjs/simple/package-lock.json index 6451d3e1..c83a835a 100644 --- a/examples/nextjs/babylonjs/simple/package-lock.json +++ b/examples/nextjs/babylonjs/simple/package-lock.json @@ -8,7 +8,7 @@ "name": "simple", "version": "0.1.0", "dependencies": { - "@bitbybit-dev/babylonjs": "0.20.14", + "@bitbybit-dev/babylonjs": "0.21.0", "file-loader": "6.2.0", "next": "15.0.1", "react": "19.0.0-rc-69d4b800-20241021", @@ -38,15 +38,15 @@ } }, "node_modules/@babylonjs/core": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.42.0.tgz", - "integrity": "sha512-Jg8bJrTW4XgcB8tssIkvW8/M2uoVcbH662cYSn2/e5jim5SVbeS3hdbtk9t56s5MJnfJoOQgkz3+hFtWjM3Tmg==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.44.1.tgz", + "integrity": "sha512-sF2WWK2d7lg18ESOCxUoRG4d1SzCWz42asjRjRGxZ8r3D7w9ZM3H2wftJIqwaZvD3zWr+wmCVKpQ6hWkboHIXw==", "license": "Apache-2.0" }, "node_modules/@babylonjs/gui": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.42.0.tgz", - "integrity": "sha512-Ayp0AhAKtPUDXrMFmgtP+PcQTQIlTkQfe20dXFakchSBBHvmoqNiBSwN7rN40XlJPps3pOaDuZsDoboJWkJxCQ==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.44.1.tgz", + "integrity": "sha512-6STDK+Hr8GpY29YMLKnTVhEnWw1NKPrIpz+MqgWuoAAmmpiFtNCr0nnAnCj5fhgGf25L89jy51ogXyg3jfiuDA==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0" @@ -61,9 +61,9 @@ } }, "node_modules/@babylonjs/loaders": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.42.0.tgz", - "integrity": "sha512-sDthqDlgU7Nn4J/TcWFwsh8+ZJqp/tQtexLYlyDxs0VXInSwu9Hm1oCCCuKAdU/e9t4Qr5+ZpfnTDa4s0PcqBA==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.44.1.tgz", + "integrity": "sha512-h5rUGCwhdWv3Hq48DP8sy4/+3QUYjOprxu2i6zXKb69LHMnYE0tZ1xQHBJEOUF60hxA+TwhzdjC8bxInKoeojA==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0", @@ -71,18 +71,18 @@ } }, "node_modules/@babylonjs/materials": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.42.0.tgz", - "integrity": "sha512-fZsc+HWDlh4qrSeC2vfjmki4854V1o9NNIQvukZhkEoT8FsHqMaUUDn6EFRjrA1TBn4SU14uxTOPWrEGvMT/ag==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.44.1.tgz", + "integrity": "sha512-FD0S/aA68oEjKCSNY5ydGkiHbsyo08KlhQ+6R8swtJhx5aq7ojWBt3P9KC78+wjZiCJW37176CIObcV8QcjMAQ==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.6.0" } }, "node_modules/@babylonjs/serializers": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.42.0.tgz", - "integrity": "sha512-VptrGNtGHn+hqpeev/ozJsPBrAn35s76rNZIdrmrLHIEJIWSo30IgNy4oZRNITcwqJ0H5Bv2r8QqBYZzQifPOg==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.44.1.tgz", + "integrity": "sha512-3FRRdKpHr2qTkALHEvq0ih0P59iTINUFrGZWFUfO3Wu24UBSuTxY9Kq820dvUUWaRtWkXEnMSQbR+5glzcfqBw==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0", @@ -90,49 +90,49 @@ } }, "node_modules/@bitbybit-dev/babylonjs": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.14.tgz", - "integrity": "sha512-5V0HlvP8IZoTMSIaaafobWmFHnwf/nXKkQF2fvDNtw2urLFUJV08SVz8FggAjQTKZHNbmDp69ovJqQmEes7+HQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.21.0.tgz", + "integrity": "sha512-8aPJ+XTXzcnO4bXfmW34lTnVCzC6Hy6TMkh7/ziQSoUsjPp7e7LFHoBBfqCk09LdTLa85gb5x/f6WNAn306Odg==", "license": "MIT", "dependencies": { - "@babylonjs/core": "8.42.0", - "@babylonjs/gui": "8.42.0", + "@babylonjs/core": "8.44.1", + "@babylonjs/gui": "8.44.1", "@babylonjs/havok": "1.3.10", - "@babylonjs/loaders": "8.42.0", - "@babylonjs/materials": "8.42.0", - "@babylonjs/serializers": "8.42.0", - "@bitbybit-dev/core": "0.20.14", + "@babylonjs/loaders": "8.44.1", + "@babylonjs/materials": "8.44.1", + "@babylonjs/serializers": "8.44.1", + "@bitbybit-dev/core": "0.21.0", "earcut": "2.2.3" } }, "node_modules/@bitbybit-dev/base": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.14.tgz", - "integrity": "sha512-Nv8eEwoVDU0Ug3TJIyzPtvIX03whvVIWsUw0xTkImFISUWmU0v1rNSaEd9FL9Rx7rMt2MC9Cxs3lXLkhZS3iAQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.21.0.tgz", + "integrity": "sha512-dNfsf2tu3/QUD1mvZzzTze8RwHyK2Jrt+Ary8EDKdNKMw+abtCpQYNerdrg0ZQPxvwu/OOQz6N1xCsCwsPkQJg==", "license": "MIT" }, "node_modules/@bitbybit-dev/core": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.14.tgz", - "integrity": "sha512-meYYY5SEfoT+NEiM2W2lpwBWtFZzvRzrTcOuzDn/uNgmzyIqUARGYZroQgGEG9XmGiCUEfeYDc7Q7ML2aesyxg==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.21.0.tgz", + "integrity": "sha512-IbeQ8ROreu0/RkkngUE+Eb19ecvqKOWhGefXvIqQmplxt3zEc0FI4Kw8wR3vYl2XMannuVt1xAIYtqqH0tjBzg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14", - "@bitbybit-dev/jscad-worker": "0.20.14", - "@bitbybit-dev/manifold-worker": "0.20.14", - "@bitbybit-dev/occt-worker": "0.20.14", + "@bitbybit-dev/base": "0.21.0", + "@bitbybit-dev/jscad-worker": "0.21.0", + "@bitbybit-dev/manifold-worker": "0.21.0", + "@bitbybit-dev/occt-worker": "0.21.0", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "node_modules/@bitbybit-dev/jscad": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.14.tgz", - "integrity": "sha512-14paqSiCmYRkJxnaaSsY0X89Y9gi8NlWw/PCjtwh0Ds32W4pMbmee2i78ygVnds19qL4Gd1wje5UukVHqPVQTA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.21.0.tgz", + "integrity": "sha512-Q7eE2ILrJRstW4L1711aJZdpwPf1kuhZJqB+KLkkBLsneRsGsh82lBcCbVYAOMuF/q8Lnd4JHxPiIG/m+LYmPQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14", + "@bitbybit-dev/base": "0.21.0", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -141,50 +141,51 @@ } }, "node_modules/@bitbybit-dev/jscad-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.14.tgz", - "integrity": "sha512-clF2kTptnZxMS2fWR+sjmnSiQ3OGF8mJYpsL4TqBdiewoIMR2IVmSoKunb0TzAucNdwsecc67gFv8OrXvW8ccA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.21.0.tgz", + "integrity": "sha512-nIvd7GH5Gg51u6PmFXOADXVYTIvixTkNf0YapS1uix7D2JS9Mx10Z4wHAeRKzvJxUAAbEPPRFNkakE22HFGtLQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/jscad": "0.20.14", + "@bitbybit-dev/jscad": "0.21.0", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/manifold": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.14.tgz", - "integrity": "sha512-Cpe3P+LblDOIiyjCsMi/fAwlyOi7AGbhAoZMgGP7ItIKqf11yXXCSRTGF2daXYSPoUht1d86wLZdjProXyAOtQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.21.0.tgz", + "integrity": "sha512-DPpwK9ESB+auDeAbzXcfWRVEzWoMDkpkjc+/uwh+zuSiHSx92PSkzx1/LVTbQCsK+aOfOOy03HQCF5Bu2KQYtw==", "license": "MIT", "dependencies": { + "@bitbybit-dev/base": "0.21.0", "manifold-3d": "3.3.2" } }, "node_modules/@bitbybit-dev/manifold-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.14.tgz", - "integrity": "sha512-o4yAo0BlxWRbv2vsg3G76QodkG3TOzMe7mWGvxeMJNvUrZTV01i9oDCOZudS9pU5lXMeSMpzRE56vbEInL8BqQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.21.0.tgz", + "integrity": "sha512-6Cqv3BP+uI8mHKHI6Jx9TzCxRg1/kMHhCe18+B3KD/rTl9B5mnScCKRBnDansR3bH7aYZGnIw9PmiFnWLkQWEQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/manifold": "0.20.14", + "@bitbybit-dev/manifold": "0.21.0", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/occt": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.14.tgz", - "integrity": "sha512-f915HUNZd345OHbvxzNm+qOudDJ92akrUCUZooYLPSdSuDubNrXPan+ZwNofB1IACHuyCF/sheNc5t6zuEiy0A==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.21.0.tgz", + "integrity": "sha512-vPu3NmF1kBZMOkOdysolGfFxEEnwdHNGORoX3eWbMWT2JL/Tag5Q2CAc5jwa2VvZnS1nE/9x+DVlFQSo8LQnIg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14" + "@bitbybit-dev/base": "0.21.0" } }, "node_modules/@bitbybit-dev/occt-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.14.tgz", - "integrity": "sha512-0AmcXulDOikH/3cs64fbedZwZ+CgxJ6OyZvlPRUHyLXMPSmExMBh3QkImGOE+APL91QNKwBlWdDW/30IBtMQXQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.21.0.tgz", + "integrity": "sha512-xG1sgo6q/RdVA8AgG72wPe4qxcQlrO1V7/Ksn6MqIhZVTsJcm5RbVYlK+nziIWhvlMc1sKE0GNQFcPdALISLuQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/occt": "0.20.14", + "@bitbybit-dev/occt": "0.21.0", "rxjs": "7.5.5" } }, @@ -255,24 +256,24 @@ } }, "node_modules/@gltf-transform/core": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.2.1.tgz", - "integrity": "sha512-qKhrQ29KJ9K6sz7xGoGRllqPBlROjPJMQPvCLBOfgMPH3S/Ph5E0e6fD5WmwTY5QPyBsDMRqKd1Vl0ncThTXGw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.3.0.tgz", + "integrity": "sha512-ZeaQfszGJ9LYwELszu45CuDQCsE26lJNNe36FVmN8xclaT6WDdCj7fwGpQXo0/l/YgAVAHX+uO7YNBW75/SRYw==", "license": "MIT", "dependencies": { - "property-graph": "^3.0.0" + "property-graph": "^4.0.0" }, "funding": { "url": "https://github.com/sponsors/donmccurdy" } }, "node_modules/@gltf-transform/extensions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.2.1.tgz", - "integrity": "sha512-ieHSJU9qvb3ucWDxgHFcff+C7fLtFPa6G0Wtc/ki7GsN6Rh7o9eoyqi7Ggj2LO4i3ynCwLLPb/onbJKw2fBtsA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.3.0.tgz", + "integrity": "sha512-XDAjQPYVMHa/VDpSbfCBwI+/1muwRJCaXhUpLgnUzAjn0D//PgvIAcbNm1EwBl3LIWBSwjDUCn2LiMAjp+aXVw==", "license": "MIT", "dependencies": { - "@gltf-transform/core": "^4.2.1", + "@gltf-transform/core": "^4.3.0", "ktx-parse": "^1.0.1" }, "funding": { @@ -280,13 +281,13 @@ } }, "node_modules/@gltf-transform/functions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.2.1.tgz", - "integrity": "sha512-hFCI80N6zt7yHlqXbzlYEYQbFwK+2OOZNvacrRtrWiCWKI0k1Ad5+nZFsmuIZZV03aXb5XG6UF7JINT3wETS1Q==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.3.0.tgz", + "integrity": "sha512-FZggHVgt3DHOezgESBrf2vDzuD2FYQYaNT2sT/aP316SIwhuiIwby3z7rhV9joDvWqqUaPkf1UmkjlOaY9riSQ==", "license": "MIT", "dependencies": { - "@gltf-transform/core": "^4.2.1", - "@gltf-transform/extensions": "^4.2.1", + "@gltf-transform/core": "^4.3.0", + "@gltf-transform/extensions": "^4.3.0", "ktx-parse": "^1.0.1", "ndarray": "^1.0.19", "ndarray-lanczos": "^0.3.0", @@ -1933,9 +1934,9 @@ } }, "node_modules/babylonjs-gltf2interface": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.42.0.tgz", - "integrity": "sha512-PYYMVNATzo3yEesPh9b9tgp0/r3O6AXcBA6vc886Pk+XWYW9xiYwTe3B6pwJVsd/Zd12t2SBhDyBpWBqK8w8sw==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.44.1.tgz", + "integrity": "sha512-+z0P0wms1FD5xuVpuRJ1qjvGAbPAWhEWGBWENRPD0Hbz6nd9cnL28/pjxgk39/QhlIuJKL9JZ0o8G0JgLHEnRQ==", "license": "Apache-2.0", "peer": true }, @@ -5541,9 +5542,9 @@ } }, "node_modules/property-graph": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-3.0.0.tgz", - "integrity": "sha512-TnzxUsttmGtw+OiU0LDw+0FlMbJ8vV8pOjyDI7+Kdni4Tj0hW5BFh7TatQu7Y68hcvvFmiFOHilKShsA4R82fA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-4.0.0.tgz", + "integrity": "sha512-I0hojAJfTbSCZy3y6xyK29eayxo14v1bj1VPiDkHjTdz33SV6RdfMz2AHnf4ai62Vng2mN5GkaKahkooBIo9gA==", "license": "MIT" }, "node_modules/punycode": { diff --git a/examples/nextjs/babylonjs/simple/package.json b/examples/nextjs/babylonjs/simple/package.json index 37df7572..0783b369 100644 --- a/examples/nextjs/babylonjs/simple/package.json +++ b/examples/nextjs/babylonjs/simple/package.json @@ -9,7 +9,7 @@ "lint": "next lint" }, "dependencies": { - "@bitbybit-dev/babylonjs": "0.20.14", + "@bitbybit-dev/babylonjs": "0.21.0", "react": "19.0.0-rc-69d4b800-20241021", "react-dom": "19.0.0-rc-69d4b800-20241021", "next": "15.0.1", diff --git a/examples/node/basic/package-lock.json b/examples/node/basic/package-lock.json index 58a81b18..6f5bf751 100644 --- a/examples/node/basic/package-lock.json +++ b/examples/node/basic/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "MIT", "dependencies": { - "@bitbybit-dev/occt": "^0.20.14" + "@bitbybit-dev/occt": "^0.21.0" }, "devDependencies": { "concurrently": "^7.6.0", @@ -34,18 +34,18 @@ } }, "node_modules/@bitbybit-dev/base": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.14.tgz", - "integrity": "sha512-Nv8eEwoVDU0Ug3TJIyzPtvIX03whvVIWsUw0xTkImFISUWmU0v1rNSaEd9FL9Rx7rMt2MC9Cxs3lXLkhZS3iAQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.21.0.tgz", + "integrity": "sha512-dNfsf2tu3/QUD1mvZzzTze8RwHyK2Jrt+Ary8EDKdNKMw+abtCpQYNerdrg0ZQPxvwu/OOQz6N1xCsCwsPkQJg==", "license": "MIT" }, "node_modules/@bitbybit-dev/occt": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.14.tgz", - "integrity": "sha512-f915HUNZd345OHbvxzNm+qOudDJ92akrUCUZooYLPSdSuDubNrXPan+ZwNofB1IACHuyCF/sheNc5t6zuEiy0A==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.21.0.tgz", + "integrity": "sha512-vPu3NmF1kBZMOkOdysolGfFxEEnwdHNGORoX3eWbMWT2JL/Tag5Q2CAc5jwa2VvZnS1nE/9x+DVlFQSo8LQnIg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14" + "@bitbybit-dev/base": "0.21.0" } }, "node_modules/ansi-regex": { diff --git a/examples/node/basic/package.json b/examples/node/basic/package.json index e8fa0856..c5f5dd6e 100644 --- a/examples/node/basic/package.json +++ b/examples/node/basic/package.json @@ -15,7 +15,7 @@ "node": ">=20.19.4" }, "dependencies": { - "@bitbybit-dev/occt": "^0.20.14" + "@bitbybit-dev/occt": "^0.21.0" }, "devDependencies": { "extensionless": "1.9.9", diff --git a/examples/node/express-app/package-lock.json b/examples/node/express-app/package-lock.json index 14027819..d041066d 100644 --- a/examples/node/express-app/package-lock.json +++ b/examples/node/express-app/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "MIT", "dependencies": { - "@bitbybit-dev/core": "0.20.14", + "@bitbybit-dev/core": "0.21.0", "cors": "^2.8.5", "dotenv": "^16.0.3", "express": "^4.18.2", @@ -41,33 +41,33 @@ } }, "node_modules/@bitbybit-dev/base": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.14.tgz", - "integrity": "sha512-Nv8eEwoVDU0Ug3TJIyzPtvIX03whvVIWsUw0xTkImFISUWmU0v1rNSaEd9FL9Rx7rMt2MC9Cxs3lXLkhZS3iAQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.21.0.tgz", + "integrity": "sha512-dNfsf2tu3/QUD1mvZzzTze8RwHyK2Jrt+Ary8EDKdNKMw+abtCpQYNerdrg0ZQPxvwu/OOQz6N1xCsCwsPkQJg==", "license": "MIT" }, "node_modules/@bitbybit-dev/core": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.14.tgz", - "integrity": "sha512-meYYY5SEfoT+NEiM2W2lpwBWtFZzvRzrTcOuzDn/uNgmzyIqUARGYZroQgGEG9XmGiCUEfeYDc7Q7ML2aesyxg==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.21.0.tgz", + "integrity": "sha512-IbeQ8ROreu0/RkkngUE+Eb19ecvqKOWhGefXvIqQmplxt3zEc0FI4Kw8wR3vYl2XMannuVt1xAIYtqqH0tjBzg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14", - "@bitbybit-dev/jscad-worker": "0.20.14", - "@bitbybit-dev/manifold-worker": "0.20.14", - "@bitbybit-dev/occt-worker": "0.20.14", + "@bitbybit-dev/base": "0.21.0", + "@bitbybit-dev/jscad-worker": "0.21.0", + "@bitbybit-dev/manifold-worker": "0.21.0", + "@bitbybit-dev/occt-worker": "0.21.0", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "node_modules/@bitbybit-dev/jscad": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.14.tgz", - "integrity": "sha512-14paqSiCmYRkJxnaaSsY0X89Y9gi8NlWw/PCjtwh0Ds32W4pMbmee2i78ygVnds19qL4Gd1wje5UukVHqPVQTA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.21.0.tgz", + "integrity": "sha512-Q7eE2ILrJRstW4L1711aJZdpwPf1kuhZJqB+KLkkBLsneRsGsh82lBcCbVYAOMuF/q8Lnd4JHxPiIG/m+LYmPQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14", + "@bitbybit-dev/base": "0.21.0", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -76,57 +76,58 @@ } }, "node_modules/@bitbybit-dev/jscad-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.14.tgz", - "integrity": "sha512-clF2kTptnZxMS2fWR+sjmnSiQ3OGF8mJYpsL4TqBdiewoIMR2IVmSoKunb0TzAucNdwsecc67gFv8OrXvW8ccA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.21.0.tgz", + "integrity": "sha512-nIvd7GH5Gg51u6PmFXOADXVYTIvixTkNf0YapS1uix7D2JS9Mx10Z4wHAeRKzvJxUAAbEPPRFNkakE22HFGtLQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/jscad": "0.20.14", + "@bitbybit-dev/jscad": "0.21.0", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/manifold": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.14.tgz", - "integrity": "sha512-Cpe3P+LblDOIiyjCsMi/fAwlyOi7AGbhAoZMgGP7ItIKqf11yXXCSRTGF2daXYSPoUht1d86wLZdjProXyAOtQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.21.0.tgz", + "integrity": "sha512-DPpwK9ESB+auDeAbzXcfWRVEzWoMDkpkjc+/uwh+zuSiHSx92PSkzx1/LVTbQCsK+aOfOOy03HQCF5Bu2KQYtw==", "license": "MIT", "dependencies": { + "@bitbybit-dev/base": "0.21.0", "manifold-3d": "3.3.2" } }, "node_modules/@bitbybit-dev/manifold-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.14.tgz", - "integrity": "sha512-o4yAo0BlxWRbv2vsg3G76QodkG3TOzMe7mWGvxeMJNvUrZTV01i9oDCOZudS9pU5lXMeSMpzRE56vbEInL8BqQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.21.0.tgz", + "integrity": "sha512-6Cqv3BP+uI8mHKHI6Jx9TzCxRg1/kMHhCe18+B3KD/rTl9B5mnScCKRBnDansR3bH7aYZGnIw9PmiFnWLkQWEQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/manifold": "0.20.14", + "@bitbybit-dev/manifold": "0.21.0", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/occt": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.14.tgz", - "integrity": "sha512-f915HUNZd345OHbvxzNm+qOudDJ92akrUCUZooYLPSdSuDubNrXPan+ZwNofB1IACHuyCF/sheNc5t6zuEiy0A==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.21.0.tgz", + "integrity": "sha512-vPu3NmF1kBZMOkOdysolGfFxEEnwdHNGORoX3eWbMWT2JL/Tag5Q2CAc5jwa2VvZnS1nE/9x+DVlFQSo8LQnIg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14" + "@bitbybit-dev/base": "0.21.0" } }, "node_modules/@bitbybit-dev/occt-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.14.tgz", - "integrity": "sha512-0AmcXulDOikH/3cs64fbedZwZ+CgxJ6OyZvlPRUHyLXMPSmExMBh3QkImGOE+APL91QNKwBlWdDW/30IBtMQXQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.21.0.tgz", + "integrity": "sha512-xG1sgo6q/RdVA8AgG72wPe4qxcQlrO1V7/Ksn6MqIhZVTsJcm5RbVYlK+nziIWhvlMc1sKE0GNQFcPdALISLuQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/occt": "0.20.14", + "@bitbybit-dev/occt": "0.21.0", "rxjs": "7.5.5" } }, "node_modules/@emnapi/runtime": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz", - "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz", + "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==", "license": "MIT", "optional": true, "dependencies": { @@ -134,24 +135,24 @@ } }, "node_modules/@gltf-transform/core": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.2.1.tgz", - "integrity": "sha512-qKhrQ29KJ9K6sz7xGoGRllqPBlROjPJMQPvCLBOfgMPH3S/Ph5E0e6fD5WmwTY5QPyBsDMRqKd1Vl0ncThTXGw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.3.0.tgz", + "integrity": "sha512-ZeaQfszGJ9LYwELszu45CuDQCsE26lJNNe36FVmN8xclaT6WDdCj7fwGpQXo0/l/YgAVAHX+uO7YNBW75/SRYw==", "license": "MIT", "dependencies": { - "property-graph": "^3.0.0" + "property-graph": "^4.0.0" }, "funding": { "url": "https://github.com/sponsors/donmccurdy" } }, "node_modules/@gltf-transform/extensions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.2.1.tgz", - "integrity": "sha512-ieHSJU9qvb3ucWDxgHFcff+C7fLtFPa6G0Wtc/ki7GsN6Rh7o9eoyqi7Ggj2LO4i3ynCwLLPb/onbJKw2fBtsA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.3.0.tgz", + "integrity": "sha512-XDAjQPYVMHa/VDpSbfCBwI+/1muwRJCaXhUpLgnUzAjn0D//PgvIAcbNm1EwBl3LIWBSwjDUCn2LiMAjp+aXVw==", "license": "MIT", "dependencies": { - "@gltf-transform/core": "^4.2.1", + "@gltf-transform/core": "^4.3.0", "ktx-parse": "^1.0.1" }, "funding": { @@ -159,13 +160,13 @@ } }, "node_modules/@gltf-transform/functions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.2.1.tgz", - "integrity": "sha512-hFCI80N6zt7yHlqXbzlYEYQbFwK+2OOZNvacrRtrWiCWKI0k1Ad5+nZFsmuIZZV03aXb5XG6UF7JINT3wETS1Q==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.3.0.tgz", + "integrity": "sha512-FZggHVgt3DHOezgESBrf2vDzuD2FYQYaNT2sT/aP316SIwhuiIwby3z7rhV9joDvWqqUaPkf1UmkjlOaY9riSQ==", "license": "MIT", "dependencies": { - "@gltf-transform/core": "^4.2.1", - "@gltf-transform/extensions": "^4.2.1", + "@gltf-transform/core": "^4.3.0", + "@gltf-transform/extensions": "^4.3.0", "ktx-parse": "^1.0.1", "ndarray": "^1.0.19", "ndarray-lanczos": "^0.3.0", @@ -2051,9 +2052,9 @@ } }, "node_modules/property-graph": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-3.0.0.tgz", - "integrity": "sha512-TnzxUsttmGtw+OiU0LDw+0FlMbJ8vV8pOjyDI7+Kdni4Tj0hW5BFh7TatQu7Y68hcvvFmiFOHilKShsA4R82fA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-4.0.0.tgz", + "integrity": "sha512-I0hojAJfTbSCZy3y6xyK29eayxo14v1bj1VPiDkHjTdz33SV6RdfMz2AHnf4ai62Vng2mN5GkaKahkooBIo9gA==", "license": "MIT" }, "node_modules/proxy-addr": { @@ -2632,30 +2633,30 @@ } }, "@bitbybit-dev/base": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.14.tgz", - "integrity": "sha512-Nv8eEwoVDU0Ug3TJIyzPtvIX03whvVIWsUw0xTkImFISUWmU0v1rNSaEd9FL9Rx7rMt2MC9Cxs3lXLkhZS3iAQ==" + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.21.0.tgz", + "integrity": "sha512-dNfsf2tu3/QUD1mvZzzTze8RwHyK2Jrt+Ary8EDKdNKMw+abtCpQYNerdrg0ZQPxvwu/OOQz6N1xCsCwsPkQJg==" }, "@bitbybit-dev/core": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.14.tgz", - "integrity": "sha512-meYYY5SEfoT+NEiM2W2lpwBWtFZzvRzrTcOuzDn/uNgmzyIqUARGYZroQgGEG9XmGiCUEfeYDc7Q7ML2aesyxg==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.21.0.tgz", + "integrity": "sha512-IbeQ8ROreu0/RkkngUE+Eb19ecvqKOWhGefXvIqQmplxt3zEc0FI4Kw8wR3vYl2XMannuVt1xAIYtqqH0tjBzg==", "requires": { - "@bitbybit-dev/base": "0.20.14", - "@bitbybit-dev/jscad-worker": "0.20.14", - "@bitbybit-dev/manifold-worker": "0.20.14", - "@bitbybit-dev/occt-worker": "0.20.14", + "@bitbybit-dev/base": "0.21.0", + "@bitbybit-dev/jscad-worker": "0.21.0", + "@bitbybit-dev/manifold-worker": "0.21.0", + "@bitbybit-dev/occt-worker": "0.21.0", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "@bitbybit-dev/jscad": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.14.tgz", - "integrity": "sha512-14paqSiCmYRkJxnaaSsY0X89Y9gi8NlWw/PCjtwh0Ds32W4pMbmee2i78ygVnds19qL4Gd1wje5UukVHqPVQTA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.21.0.tgz", + "integrity": "sha512-Q7eE2ILrJRstW4L1711aJZdpwPf1kuhZJqB+KLkkBLsneRsGsh82lBcCbVYAOMuF/q8Lnd4JHxPiIG/m+LYmPQ==", "requires": { - "@bitbybit-dev/base": "0.20.14", + "@bitbybit-dev/base": "0.21.0", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -2664,81 +2665,82 @@ } }, "@bitbybit-dev/jscad-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.14.tgz", - "integrity": "sha512-clF2kTptnZxMS2fWR+sjmnSiQ3OGF8mJYpsL4TqBdiewoIMR2IVmSoKunb0TzAucNdwsecc67gFv8OrXvW8ccA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.21.0.tgz", + "integrity": "sha512-nIvd7GH5Gg51u6PmFXOADXVYTIvixTkNf0YapS1uix7D2JS9Mx10Z4wHAeRKzvJxUAAbEPPRFNkakE22HFGtLQ==", "requires": { - "@bitbybit-dev/jscad": "0.20.14", + "@bitbybit-dev/jscad": "0.21.0", "rxjs": "7.5.5" } }, "@bitbybit-dev/manifold": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.14.tgz", - "integrity": "sha512-Cpe3P+LblDOIiyjCsMi/fAwlyOi7AGbhAoZMgGP7ItIKqf11yXXCSRTGF2daXYSPoUht1d86wLZdjProXyAOtQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.21.0.tgz", + "integrity": "sha512-DPpwK9ESB+auDeAbzXcfWRVEzWoMDkpkjc+/uwh+zuSiHSx92PSkzx1/LVTbQCsK+aOfOOy03HQCF5Bu2KQYtw==", "requires": { + "@bitbybit-dev/base": "0.21.0", "manifold-3d": "3.3.2" } }, "@bitbybit-dev/manifold-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.14.tgz", - "integrity": "sha512-o4yAo0BlxWRbv2vsg3G76QodkG3TOzMe7mWGvxeMJNvUrZTV01i9oDCOZudS9pU5lXMeSMpzRE56vbEInL8BqQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.21.0.tgz", + "integrity": "sha512-6Cqv3BP+uI8mHKHI6Jx9TzCxRg1/kMHhCe18+B3KD/rTl9B5mnScCKRBnDansR3bH7aYZGnIw9PmiFnWLkQWEQ==", "requires": { - "@bitbybit-dev/manifold": "0.20.14", + "@bitbybit-dev/manifold": "0.21.0", "rxjs": "7.5.5" } }, "@bitbybit-dev/occt": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.14.tgz", - "integrity": "sha512-f915HUNZd345OHbvxzNm+qOudDJ92akrUCUZooYLPSdSuDubNrXPan+ZwNofB1IACHuyCF/sheNc5t6zuEiy0A==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.21.0.tgz", + "integrity": "sha512-vPu3NmF1kBZMOkOdysolGfFxEEnwdHNGORoX3eWbMWT2JL/Tag5Q2CAc5jwa2VvZnS1nE/9x+DVlFQSo8LQnIg==", "requires": { - "@bitbybit-dev/base": "0.20.14" + "@bitbybit-dev/base": "0.21.0" } }, "@bitbybit-dev/occt-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.14.tgz", - "integrity": "sha512-0AmcXulDOikH/3cs64fbedZwZ+CgxJ6OyZvlPRUHyLXMPSmExMBh3QkImGOE+APL91QNKwBlWdDW/30IBtMQXQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.21.0.tgz", + "integrity": "sha512-xG1sgo6q/RdVA8AgG72wPe4qxcQlrO1V7/Ksn6MqIhZVTsJcm5RbVYlK+nziIWhvlMc1sKE0GNQFcPdALISLuQ==", "requires": { - "@bitbybit-dev/occt": "0.20.14", + "@bitbybit-dev/occt": "0.21.0", "rxjs": "7.5.5" } }, "@emnapi/runtime": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz", - "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz", + "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==", "optional": true, "requires": { "tslib": "^2.4.0" } }, "@gltf-transform/core": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.2.1.tgz", - "integrity": "sha512-qKhrQ29KJ9K6sz7xGoGRllqPBlROjPJMQPvCLBOfgMPH3S/Ph5E0e6fD5WmwTY5QPyBsDMRqKd1Vl0ncThTXGw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.3.0.tgz", + "integrity": "sha512-ZeaQfszGJ9LYwELszu45CuDQCsE26lJNNe36FVmN8xclaT6WDdCj7fwGpQXo0/l/YgAVAHX+uO7YNBW75/SRYw==", "requires": { - "property-graph": "^3.0.0" + "property-graph": "^4.0.0" } }, "@gltf-transform/extensions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.2.1.tgz", - "integrity": "sha512-ieHSJU9qvb3ucWDxgHFcff+C7fLtFPa6G0Wtc/ki7GsN6Rh7o9eoyqi7Ggj2LO4i3ynCwLLPb/onbJKw2fBtsA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.3.0.tgz", + "integrity": "sha512-XDAjQPYVMHa/VDpSbfCBwI+/1muwRJCaXhUpLgnUzAjn0D//PgvIAcbNm1EwBl3LIWBSwjDUCn2LiMAjp+aXVw==", "requires": { - "@gltf-transform/core": "^4.2.1", + "@gltf-transform/core": "^4.3.0", "ktx-parse": "^1.0.1" } }, "@gltf-transform/functions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.2.1.tgz", - "integrity": "sha512-hFCI80N6zt7yHlqXbzlYEYQbFwK+2OOZNvacrRtrWiCWKI0k1Ad5+nZFsmuIZZV03aXb5XG6UF7JINT3wETS1Q==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.3.0.tgz", + "integrity": "sha512-FZggHVgt3DHOezgESBrf2vDzuD2FYQYaNT2sT/aP316SIwhuiIwby3z7rhV9joDvWqqUaPkf1UmkjlOaY9riSQ==", "requires": { - "@gltf-transform/core": "^4.2.1", - "@gltf-transform/extensions": "^4.2.1", + "@gltf-transform/core": "^4.3.0", + "@gltf-transform/extensions": "^4.3.0", "ktx-parse": "^1.0.1", "ndarray": "^1.0.19", "ndarray-lanczos": "^0.3.0", @@ -3987,9 +3989,9 @@ "dev": true }, "property-graph": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-3.0.0.tgz", - "integrity": "sha512-TnzxUsttmGtw+OiU0LDw+0FlMbJ8vV8pOjyDI7+Kdni4Tj0hW5BFh7TatQu7Y68hcvvFmiFOHilKShsA4R82fA==" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-4.0.0.tgz", + "integrity": "sha512-I0hojAJfTbSCZy3y6xyK29eayxo14v1bj1VPiDkHjTdz33SV6RdfMz2AHnf4ai62Vng2mN5GkaKahkooBIo9gA==" }, "proxy-addr": { "version": "2.0.7", diff --git a/examples/node/express-app/package.json b/examples/node/express-app/package.json index ff085211..fc99a1d2 100644 --- a/examples/node/express-app/package.json +++ b/examples/node/express-app/package.json @@ -11,7 +11,7 @@ "author": "Bit By Bit Developers", "license": "MIT", "dependencies": { - "@bitbybit-dev/core": "0.20.14", + "@bitbybit-dev/core": "0.21.0", "cors": "^2.8.5", "dotenv": "^16.0.3", "express": "^4.18.2", diff --git a/examples/nuxt/babylonjs/basic/package-lock.json b/examples/nuxt/babylonjs/basic/package-lock.json index b46442b7..cb4a0b5c 100644 --- a/examples/nuxt/babylonjs/basic/package-lock.json +++ b/examples/nuxt/babylonjs/basic/package-lock.json @@ -8,7 +8,7 @@ "hasInstallScript": true, "license": "MIT", "dependencies": { - "@bitbybit-dev/babylonjs": "0.20.14", + "@bitbybit-dev/babylonjs": "0.21.0", "@pinia/nuxt": "^0.5.4", "nuxt": "^3.13.0", "pinia": "^2.2.2", @@ -486,15 +486,15 @@ } }, "node_modules/@babylonjs/core": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.42.0.tgz", - "integrity": "sha512-Jg8bJrTW4XgcB8tssIkvW8/M2uoVcbH662cYSn2/e5jim5SVbeS3hdbtk9t56s5MJnfJoOQgkz3+hFtWjM3Tmg==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.44.1.tgz", + "integrity": "sha512-sF2WWK2d7lg18ESOCxUoRG4d1SzCWz42asjRjRGxZ8r3D7w9ZM3H2wftJIqwaZvD3zWr+wmCVKpQ6hWkboHIXw==", "license": "Apache-2.0" }, "node_modules/@babylonjs/gui": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.42.0.tgz", - "integrity": "sha512-Ayp0AhAKtPUDXrMFmgtP+PcQTQIlTkQfe20dXFakchSBBHvmoqNiBSwN7rN40XlJPps3pOaDuZsDoboJWkJxCQ==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.44.1.tgz", + "integrity": "sha512-6STDK+Hr8GpY29YMLKnTVhEnWw1NKPrIpz+MqgWuoAAmmpiFtNCr0nnAnCj5fhgGf25L89jy51ogXyg3jfiuDA==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0" @@ -509,9 +509,9 @@ } }, "node_modules/@babylonjs/loaders": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.42.0.tgz", - "integrity": "sha512-sDthqDlgU7Nn4J/TcWFwsh8+ZJqp/tQtexLYlyDxs0VXInSwu9Hm1oCCCuKAdU/e9t4Qr5+ZpfnTDa4s0PcqBA==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.44.1.tgz", + "integrity": "sha512-h5rUGCwhdWv3Hq48DP8sy4/+3QUYjOprxu2i6zXKb69LHMnYE0tZ1xQHBJEOUF60hxA+TwhzdjC8bxInKoeojA==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0", @@ -519,18 +519,18 @@ } }, "node_modules/@babylonjs/materials": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.42.0.tgz", - "integrity": "sha512-fZsc+HWDlh4qrSeC2vfjmki4854V1o9NNIQvukZhkEoT8FsHqMaUUDn6EFRjrA1TBn4SU14uxTOPWrEGvMT/ag==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.44.1.tgz", + "integrity": "sha512-FD0S/aA68oEjKCSNY5ydGkiHbsyo08KlhQ+6R8swtJhx5aq7ojWBt3P9KC78+wjZiCJW37176CIObcV8QcjMAQ==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.6.0" } }, "node_modules/@babylonjs/serializers": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.42.0.tgz", - "integrity": "sha512-VptrGNtGHn+hqpeev/ozJsPBrAn35s76rNZIdrmrLHIEJIWSo30IgNy4oZRNITcwqJ0H5Bv2r8QqBYZzQifPOg==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.44.1.tgz", + "integrity": "sha512-3FRRdKpHr2qTkALHEvq0ih0P59iTINUFrGZWFUfO3Wu24UBSuTxY9Kq820dvUUWaRtWkXEnMSQbR+5glzcfqBw==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0", @@ -538,49 +538,49 @@ } }, "node_modules/@bitbybit-dev/babylonjs": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.14.tgz", - "integrity": "sha512-5V0HlvP8IZoTMSIaaafobWmFHnwf/nXKkQF2fvDNtw2urLFUJV08SVz8FggAjQTKZHNbmDp69ovJqQmEes7+HQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.21.0.tgz", + "integrity": "sha512-8aPJ+XTXzcnO4bXfmW34lTnVCzC6Hy6TMkh7/ziQSoUsjPp7e7LFHoBBfqCk09LdTLa85gb5x/f6WNAn306Odg==", "license": "MIT", "dependencies": { - "@babylonjs/core": "8.42.0", - "@babylonjs/gui": "8.42.0", + "@babylonjs/core": "8.44.1", + "@babylonjs/gui": "8.44.1", "@babylonjs/havok": "1.3.10", - "@babylonjs/loaders": "8.42.0", - "@babylonjs/materials": "8.42.0", - "@babylonjs/serializers": "8.42.0", - "@bitbybit-dev/core": "0.20.14", + "@babylonjs/loaders": "8.44.1", + "@babylonjs/materials": "8.44.1", + "@babylonjs/serializers": "8.44.1", + "@bitbybit-dev/core": "0.21.0", "earcut": "2.2.3" } }, "node_modules/@bitbybit-dev/base": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.14.tgz", - "integrity": "sha512-Nv8eEwoVDU0Ug3TJIyzPtvIX03whvVIWsUw0xTkImFISUWmU0v1rNSaEd9FL9Rx7rMt2MC9Cxs3lXLkhZS3iAQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.21.0.tgz", + "integrity": "sha512-dNfsf2tu3/QUD1mvZzzTze8RwHyK2Jrt+Ary8EDKdNKMw+abtCpQYNerdrg0ZQPxvwu/OOQz6N1xCsCwsPkQJg==", "license": "MIT" }, "node_modules/@bitbybit-dev/core": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.14.tgz", - "integrity": "sha512-meYYY5SEfoT+NEiM2W2lpwBWtFZzvRzrTcOuzDn/uNgmzyIqUARGYZroQgGEG9XmGiCUEfeYDc7Q7ML2aesyxg==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.21.0.tgz", + "integrity": "sha512-IbeQ8ROreu0/RkkngUE+Eb19ecvqKOWhGefXvIqQmplxt3zEc0FI4Kw8wR3vYl2XMannuVt1xAIYtqqH0tjBzg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14", - "@bitbybit-dev/jscad-worker": "0.20.14", - "@bitbybit-dev/manifold-worker": "0.20.14", - "@bitbybit-dev/occt-worker": "0.20.14", + "@bitbybit-dev/base": "0.21.0", + "@bitbybit-dev/jscad-worker": "0.21.0", + "@bitbybit-dev/manifold-worker": "0.21.0", + "@bitbybit-dev/occt-worker": "0.21.0", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "node_modules/@bitbybit-dev/jscad": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.14.tgz", - "integrity": "sha512-14paqSiCmYRkJxnaaSsY0X89Y9gi8NlWw/PCjtwh0Ds32W4pMbmee2i78ygVnds19qL4Gd1wje5UukVHqPVQTA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.21.0.tgz", + "integrity": "sha512-Q7eE2ILrJRstW4L1711aJZdpwPf1kuhZJqB+KLkkBLsneRsGsh82lBcCbVYAOMuF/q8Lnd4JHxPiIG/m+LYmPQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14", + "@bitbybit-dev/base": "0.21.0", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -589,50 +589,51 @@ } }, "node_modules/@bitbybit-dev/jscad-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.14.tgz", - "integrity": "sha512-clF2kTptnZxMS2fWR+sjmnSiQ3OGF8mJYpsL4TqBdiewoIMR2IVmSoKunb0TzAucNdwsecc67gFv8OrXvW8ccA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.21.0.tgz", + "integrity": "sha512-nIvd7GH5Gg51u6PmFXOADXVYTIvixTkNf0YapS1uix7D2JS9Mx10Z4wHAeRKzvJxUAAbEPPRFNkakE22HFGtLQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/jscad": "0.20.14", + "@bitbybit-dev/jscad": "0.21.0", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/manifold": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.14.tgz", - "integrity": "sha512-Cpe3P+LblDOIiyjCsMi/fAwlyOi7AGbhAoZMgGP7ItIKqf11yXXCSRTGF2daXYSPoUht1d86wLZdjProXyAOtQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.21.0.tgz", + "integrity": "sha512-DPpwK9ESB+auDeAbzXcfWRVEzWoMDkpkjc+/uwh+zuSiHSx92PSkzx1/LVTbQCsK+aOfOOy03HQCF5Bu2KQYtw==", "license": "MIT", "dependencies": { + "@bitbybit-dev/base": "0.21.0", "manifold-3d": "3.3.2" } }, "node_modules/@bitbybit-dev/manifold-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.14.tgz", - "integrity": "sha512-o4yAo0BlxWRbv2vsg3G76QodkG3TOzMe7mWGvxeMJNvUrZTV01i9oDCOZudS9pU5lXMeSMpzRE56vbEInL8BqQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.21.0.tgz", + "integrity": "sha512-6Cqv3BP+uI8mHKHI6Jx9TzCxRg1/kMHhCe18+B3KD/rTl9B5mnScCKRBnDansR3bH7aYZGnIw9PmiFnWLkQWEQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/manifold": "0.20.14", + "@bitbybit-dev/manifold": "0.21.0", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/occt": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.14.tgz", - "integrity": "sha512-f915HUNZd345OHbvxzNm+qOudDJ92akrUCUZooYLPSdSuDubNrXPan+ZwNofB1IACHuyCF/sheNc5t6zuEiy0A==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.21.0.tgz", + "integrity": "sha512-vPu3NmF1kBZMOkOdysolGfFxEEnwdHNGORoX3eWbMWT2JL/Tag5Q2CAc5jwa2VvZnS1nE/9x+DVlFQSo8LQnIg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14" + "@bitbybit-dev/base": "0.21.0" } }, "node_modules/@bitbybit-dev/occt-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.14.tgz", - "integrity": "sha512-0AmcXulDOikH/3cs64fbedZwZ+CgxJ6OyZvlPRUHyLXMPSmExMBh3QkImGOE+APL91QNKwBlWdDW/30IBtMQXQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.21.0.tgz", + "integrity": "sha512-xG1sgo6q/RdVA8AgG72wPe4qxcQlrO1V7/Ksn6MqIhZVTsJcm5RbVYlK+nziIWhvlMc1sKE0GNQFcPdALISLuQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/occt": "0.20.14", + "@bitbybit-dev/occt": "0.21.0", "rxjs": "7.5.5" } }, @@ -659,9 +660,9 @@ } }, "node_modules/@emnapi/runtime": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz", - "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz", + "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==", "license": "MIT", "optional": true, "dependencies": { @@ -1037,24 +1038,24 @@ } }, "node_modules/@gltf-transform/core": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.2.1.tgz", - "integrity": "sha512-qKhrQ29KJ9K6sz7xGoGRllqPBlROjPJMQPvCLBOfgMPH3S/Ph5E0e6fD5WmwTY5QPyBsDMRqKd1Vl0ncThTXGw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.3.0.tgz", + "integrity": "sha512-ZeaQfszGJ9LYwELszu45CuDQCsE26lJNNe36FVmN8xclaT6WDdCj7fwGpQXo0/l/YgAVAHX+uO7YNBW75/SRYw==", "license": "MIT", "dependencies": { - "property-graph": "^3.0.0" + "property-graph": "^4.0.0" }, "funding": { "url": "https://github.com/sponsors/donmccurdy" } }, "node_modules/@gltf-transform/extensions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.2.1.tgz", - "integrity": "sha512-ieHSJU9qvb3ucWDxgHFcff+C7fLtFPa6G0Wtc/ki7GsN6Rh7o9eoyqi7Ggj2LO4i3ynCwLLPb/onbJKw2fBtsA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.3.0.tgz", + "integrity": "sha512-XDAjQPYVMHa/VDpSbfCBwI+/1muwRJCaXhUpLgnUzAjn0D//PgvIAcbNm1EwBl3LIWBSwjDUCn2LiMAjp+aXVw==", "license": "MIT", "dependencies": { - "@gltf-transform/core": "^4.2.1", + "@gltf-transform/core": "^4.3.0", "ktx-parse": "^1.0.1" }, "funding": { @@ -1062,13 +1063,13 @@ } }, "node_modules/@gltf-transform/functions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.2.1.tgz", - "integrity": "sha512-hFCI80N6zt7yHlqXbzlYEYQbFwK+2OOZNvacrRtrWiCWKI0k1Ad5+nZFsmuIZZV03aXb5XG6UF7JINT3wETS1Q==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.3.0.tgz", + "integrity": "sha512-FZggHVgt3DHOezgESBrf2vDzuD2FYQYaNT2sT/aP316SIwhuiIwby3z7rhV9joDvWqqUaPkf1UmkjlOaY9riSQ==", "license": "MIT", "dependencies": { - "@gltf-transform/core": "^4.2.1", - "@gltf-transform/extensions": "^4.2.1", + "@gltf-transform/core": "^4.3.0", + "@gltf-transform/extensions": "^4.3.0", "ktx-parse": "^1.0.1", "ndarray": "^1.0.19", "ndarray-lanczos": "^0.3.0", @@ -3558,9 +3559,9 @@ "integrity": "sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg==" }, "node_modules/babylonjs-gltf2interface": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.42.0.tgz", - "integrity": "sha512-PYYMVNATzo3yEesPh9b9tgp0/r3O6AXcBA6vc886Pk+XWYW9xiYwTe3B6pwJVsd/Zd12t2SBhDyBpWBqK8w8sw==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.44.1.tgz", + "integrity": "sha512-+z0P0wms1FD5xuVpuRJ1qjvGAbPAWhEWGBWENRPD0Hbz6nd9cnL28/pjxgk39/QhlIuJKL9JZ0o8G0JgLHEnRQ==", "license": "Apache-2.0", "peer": true }, @@ -7823,9 +7824,9 @@ } }, "node_modules/property-graph": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-3.0.0.tgz", - "integrity": "sha512-TnzxUsttmGtw+OiU0LDw+0FlMbJ8vV8pOjyDI7+Kdni4Tj0hW5BFh7TatQu7Y68hcvvFmiFOHilKShsA4R82fA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-4.0.0.tgz", + "integrity": "sha512-I0hojAJfTbSCZy3y6xyK29eayxo14v1bj1VPiDkHjTdz33SV6RdfMz2AHnf4ai62Vng2mN5GkaKahkooBIo9gA==", "license": "MIT" }, "node_modules/protocols": { diff --git a/examples/nuxt/babylonjs/basic/package.json b/examples/nuxt/babylonjs/basic/package.json index 4f55e580..6583831e 100644 --- a/examples/nuxt/babylonjs/basic/package.json +++ b/examples/nuxt/babylonjs/basic/package.json @@ -11,7 +11,7 @@ "postinstall": "nuxt prepare" }, "dependencies": { - "@bitbybit-dev/babylonjs": "0.20.14", + "@bitbybit-dev/babylonjs": "0.21.0", "@pinia/nuxt": "^0.5.4", "nuxt": "^3.13.0", "pinia": "^2.2.2", diff --git a/examples/package.json b/examples/package.json index 547a3cde..630afa9d 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,6 +1,6 @@ { "name": "bitbybit-examples", - "version": "0.20.14", + "version": "0.21.0", "description": "Monorepo for browser CAD which holds bitbybit.dev npm packages", "main": "index.js", "scripts": { diff --git a/examples/react/babylonjs/cup/package-lock.json b/examples/react/babylonjs/cup/package-lock.json index fbd80d23..fcef378c 100644 --- a/examples/react/babylonjs/cup/package-lock.json +++ b/examples/react/babylonjs/cup/package-lock.json @@ -8,7 +8,7 @@ "name": "cup", "version": "0.1.0", "dependencies": { - "@bitbybit-dev/babylonjs": "0.20.14", + "@bitbybit-dev/babylonjs": "0.21.0", "@emotion/react": "11.9.0", "@emotion/styled": "11.8.1", "@mui/icons-material": "5.6.2", @@ -1809,15 +1809,15 @@ } }, "node_modules/@babylonjs/core": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.42.0.tgz", - "integrity": "sha512-Jg8bJrTW4XgcB8tssIkvW8/M2uoVcbH662cYSn2/e5jim5SVbeS3hdbtk9t56s5MJnfJoOQgkz3+hFtWjM3Tmg==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.44.1.tgz", + "integrity": "sha512-sF2WWK2d7lg18ESOCxUoRG4d1SzCWz42asjRjRGxZ8r3D7w9ZM3H2wftJIqwaZvD3zWr+wmCVKpQ6hWkboHIXw==", "license": "Apache-2.0" }, "node_modules/@babylonjs/gui": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.42.0.tgz", - "integrity": "sha512-Ayp0AhAKtPUDXrMFmgtP+PcQTQIlTkQfe20dXFakchSBBHvmoqNiBSwN7rN40XlJPps3pOaDuZsDoboJWkJxCQ==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.44.1.tgz", + "integrity": "sha512-6STDK+Hr8GpY29YMLKnTVhEnWw1NKPrIpz+MqgWuoAAmmpiFtNCr0nnAnCj5fhgGf25L89jy51ogXyg3jfiuDA==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0" @@ -1832,9 +1832,9 @@ } }, "node_modules/@babylonjs/loaders": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.42.0.tgz", - "integrity": "sha512-sDthqDlgU7Nn4J/TcWFwsh8+ZJqp/tQtexLYlyDxs0VXInSwu9Hm1oCCCuKAdU/e9t4Qr5+ZpfnTDa4s0PcqBA==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.44.1.tgz", + "integrity": "sha512-h5rUGCwhdWv3Hq48DP8sy4/+3QUYjOprxu2i6zXKb69LHMnYE0tZ1xQHBJEOUF60hxA+TwhzdjC8bxInKoeojA==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0", @@ -1842,18 +1842,18 @@ } }, "node_modules/@babylonjs/materials": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.42.0.tgz", - "integrity": "sha512-fZsc+HWDlh4qrSeC2vfjmki4854V1o9NNIQvukZhkEoT8FsHqMaUUDn6EFRjrA1TBn4SU14uxTOPWrEGvMT/ag==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.44.1.tgz", + "integrity": "sha512-FD0S/aA68oEjKCSNY5ydGkiHbsyo08KlhQ+6R8swtJhx5aq7ojWBt3P9KC78+wjZiCJW37176CIObcV8QcjMAQ==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.6.0" } }, "node_modules/@babylonjs/serializers": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.42.0.tgz", - "integrity": "sha512-VptrGNtGHn+hqpeev/ozJsPBrAn35s76rNZIdrmrLHIEJIWSo30IgNy4oZRNITcwqJ0H5Bv2r8QqBYZzQifPOg==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.44.1.tgz", + "integrity": "sha512-3FRRdKpHr2qTkALHEvq0ih0P59iTINUFrGZWFUfO3Wu24UBSuTxY9Kq820dvUUWaRtWkXEnMSQbR+5glzcfqBw==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0", @@ -1866,49 +1866,49 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==" }, "node_modules/@bitbybit-dev/babylonjs": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.14.tgz", - "integrity": "sha512-5V0HlvP8IZoTMSIaaafobWmFHnwf/nXKkQF2fvDNtw2urLFUJV08SVz8FggAjQTKZHNbmDp69ovJqQmEes7+HQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.21.0.tgz", + "integrity": "sha512-8aPJ+XTXzcnO4bXfmW34lTnVCzC6Hy6TMkh7/ziQSoUsjPp7e7LFHoBBfqCk09LdTLa85gb5x/f6WNAn306Odg==", "license": "MIT", "dependencies": { - "@babylonjs/core": "8.42.0", - "@babylonjs/gui": "8.42.0", + "@babylonjs/core": "8.44.1", + "@babylonjs/gui": "8.44.1", "@babylonjs/havok": "1.3.10", - "@babylonjs/loaders": "8.42.0", - "@babylonjs/materials": "8.42.0", - "@babylonjs/serializers": "8.42.0", - "@bitbybit-dev/core": "0.20.14", + "@babylonjs/loaders": "8.44.1", + "@babylonjs/materials": "8.44.1", + "@babylonjs/serializers": "8.44.1", + "@bitbybit-dev/core": "0.21.0", "earcut": "2.2.3" } }, "node_modules/@bitbybit-dev/base": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.14.tgz", - "integrity": "sha512-Nv8eEwoVDU0Ug3TJIyzPtvIX03whvVIWsUw0xTkImFISUWmU0v1rNSaEd9FL9Rx7rMt2MC9Cxs3lXLkhZS3iAQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.21.0.tgz", + "integrity": "sha512-dNfsf2tu3/QUD1mvZzzTze8RwHyK2Jrt+Ary8EDKdNKMw+abtCpQYNerdrg0ZQPxvwu/OOQz6N1xCsCwsPkQJg==", "license": "MIT" }, "node_modules/@bitbybit-dev/core": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.14.tgz", - "integrity": "sha512-meYYY5SEfoT+NEiM2W2lpwBWtFZzvRzrTcOuzDn/uNgmzyIqUARGYZroQgGEG9XmGiCUEfeYDc7Q7ML2aesyxg==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.21.0.tgz", + "integrity": "sha512-IbeQ8ROreu0/RkkngUE+Eb19ecvqKOWhGefXvIqQmplxt3zEc0FI4Kw8wR3vYl2XMannuVt1xAIYtqqH0tjBzg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14", - "@bitbybit-dev/jscad-worker": "0.20.14", - "@bitbybit-dev/manifold-worker": "0.20.14", - "@bitbybit-dev/occt-worker": "0.20.14", + "@bitbybit-dev/base": "0.21.0", + "@bitbybit-dev/jscad-worker": "0.21.0", + "@bitbybit-dev/manifold-worker": "0.21.0", + "@bitbybit-dev/occt-worker": "0.21.0", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "node_modules/@bitbybit-dev/jscad": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.14.tgz", - "integrity": "sha512-14paqSiCmYRkJxnaaSsY0X89Y9gi8NlWw/PCjtwh0Ds32W4pMbmee2i78ygVnds19qL4Gd1wje5UukVHqPVQTA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.21.0.tgz", + "integrity": "sha512-Q7eE2ILrJRstW4L1711aJZdpwPf1kuhZJqB+KLkkBLsneRsGsh82lBcCbVYAOMuF/q8Lnd4JHxPiIG/m+LYmPQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14", + "@bitbybit-dev/base": "0.21.0", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -1917,50 +1917,51 @@ } }, "node_modules/@bitbybit-dev/jscad-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.14.tgz", - "integrity": "sha512-clF2kTptnZxMS2fWR+sjmnSiQ3OGF8mJYpsL4TqBdiewoIMR2IVmSoKunb0TzAucNdwsecc67gFv8OrXvW8ccA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.21.0.tgz", + "integrity": "sha512-nIvd7GH5Gg51u6PmFXOADXVYTIvixTkNf0YapS1uix7D2JS9Mx10Z4wHAeRKzvJxUAAbEPPRFNkakE22HFGtLQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/jscad": "0.20.14", + "@bitbybit-dev/jscad": "0.21.0", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/manifold": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.14.tgz", - "integrity": "sha512-Cpe3P+LblDOIiyjCsMi/fAwlyOi7AGbhAoZMgGP7ItIKqf11yXXCSRTGF2daXYSPoUht1d86wLZdjProXyAOtQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.21.0.tgz", + "integrity": "sha512-DPpwK9ESB+auDeAbzXcfWRVEzWoMDkpkjc+/uwh+zuSiHSx92PSkzx1/LVTbQCsK+aOfOOy03HQCF5Bu2KQYtw==", "license": "MIT", "dependencies": { + "@bitbybit-dev/base": "0.21.0", "manifold-3d": "3.3.2" } }, "node_modules/@bitbybit-dev/manifold-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.14.tgz", - "integrity": "sha512-o4yAo0BlxWRbv2vsg3G76QodkG3TOzMe7mWGvxeMJNvUrZTV01i9oDCOZudS9pU5lXMeSMpzRE56vbEInL8BqQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.21.0.tgz", + "integrity": "sha512-6Cqv3BP+uI8mHKHI6Jx9TzCxRg1/kMHhCe18+B3KD/rTl9B5mnScCKRBnDansR3bH7aYZGnIw9PmiFnWLkQWEQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/manifold": "0.20.14", + "@bitbybit-dev/manifold": "0.21.0", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/occt": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.14.tgz", - "integrity": "sha512-f915HUNZd345OHbvxzNm+qOudDJ92akrUCUZooYLPSdSuDubNrXPan+ZwNofB1IACHuyCF/sheNc5t6zuEiy0A==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.21.0.tgz", + "integrity": "sha512-vPu3NmF1kBZMOkOdysolGfFxEEnwdHNGORoX3eWbMWT2JL/Tag5Q2CAc5jwa2VvZnS1nE/9x+DVlFQSo8LQnIg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14" + "@bitbybit-dev/base": "0.21.0" } }, "node_modules/@bitbybit-dev/occt-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.14.tgz", - "integrity": "sha512-0AmcXulDOikH/3cs64fbedZwZ+CgxJ6OyZvlPRUHyLXMPSmExMBh3QkImGOE+APL91QNKwBlWdDW/30IBtMQXQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.21.0.tgz", + "integrity": "sha512-xG1sgo6q/RdVA8AgG72wPe4qxcQlrO1V7/Ksn6MqIhZVTsJcm5RbVYlK+nziIWhvlMc1sKE0GNQFcPdALISLuQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/occt": "0.20.14", + "@bitbybit-dev/occt": "0.21.0", "rxjs": "7.5.5" } }, @@ -2236,9 +2237,9 @@ } }, "node_modules/@emnapi/runtime": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz", - "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz", + "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==", "license": "MIT", "optional": true, "dependencies": { @@ -2449,24 +2450,24 @@ } }, "node_modules/@gltf-transform/core": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.2.1.tgz", - "integrity": "sha512-qKhrQ29KJ9K6sz7xGoGRllqPBlROjPJMQPvCLBOfgMPH3S/Ph5E0e6fD5WmwTY5QPyBsDMRqKd1Vl0ncThTXGw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.3.0.tgz", + "integrity": "sha512-ZeaQfszGJ9LYwELszu45CuDQCsE26lJNNe36FVmN8xclaT6WDdCj7fwGpQXo0/l/YgAVAHX+uO7YNBW75/SRYw==", "license": "MIT", "dependencies": { - "property-graph": "^3.0.0" + "property-graph": "^4.0.0" }, "funding": { "url": "https://github.com/sponsors/donmccurdy" } }, "node_modules/@gltf-transform/extensions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.2.1.tgz", - "integrity": "sha512-ieHSJU9qvb3ucWDxgHFcff+C7fLtFPa6G0Wtc/ki7GsN6Rh7o9eoyqi7Ggj2LO4i3ynCwLLPb/onbJKw2fBtsA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.3.0.tgz", + "integrity": "sha512-XDAjQPYVMHa/VDpSbfCBwI+/1muwRJCaXhUpLgnUzAjn0D//PgvIAcbNm1EwBl3LIWBSwjDUCn2LiMAjp+aXVw==", "license": "MIT", "dependencies": { - "@gltf-transform/core": "^4.2.1", + "@gltf-transform/core": "^4.3.0", "ktx-parse": "^1.0.1" }, "funding": { @@ -2474,13 +2475,13 @@ } }, "node_modules/@gltf-transform/functions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.2.1.tgz", - "integrity": "sha512-hFCI80N6zt7yHlqXbzlYEYQbFwK+2OOZNvacrRtrWiCWKI0k1Ad5+nZFsmuIZZV03aXb5XG6UF7JINT3wETS1Q==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.3.0.tgz", + "integrity": "sha512-FZggHVgt3DHOezgESBrf2vDzuD2FYQYaNT2sT/aP316SIwhuiIwby3z7rhV9joDvWqqUaPkf1UmkjlOaY9riSQ==", "license": "MIT", "dependencies": { - "@gltf-transform/core": "^4.2.1", - "@gltf-transform/extensions": "^4.2.1", + "@gltf-transform/core": "^4.3.0", + "@gltf-transform/extensions": "^4.3.0", "ktx-parse": "^1.0.1", "ndarray": "^1.0.19", "ndarray-lanczos": "^0.3.0", @@ -6224,9 +6225,9 @@ } }, "node_modules/babylonjs-gltf2interface": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.42.0.tgz", - "integrity": "sha512-PYYMVNATzo3yEesPh9b9tgp0/r3O6AXcBA6vc886Pk+XWYW9xiYwTe3B6pwJVsd/Zd12t2SBhDyBpWBqK8w8sw==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.44.1.tgz", + "integrity": "sha512-+z0P0wms1FD5xuVpuRJ1qjvGAbPAWhEWGBWENRPD0Hbz6nd9cnL28/pjxgk39/QhlIuJKL9JZ0o8G0JgLHEnRQ==", "license": "Apache-2.0", "peer": true }, @@ -15254,9 +15255,9 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, "node_modules/property-graph": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-3.0.0.tgz", - "integrity": "sha512-TnzxUsttmGtw+OiU0LDw+0FlMbJ8vV8pOjyDI7+Kdni4Tj0hW5BFh7TatQu7Y68hcvvFmiFOHilKShsA4R82fA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-4.0.0.tgz", + "integrity": "sha512-I0hojAJfTbSCZy3y6xyK29eayxo14v1bj1VPiDkHjTdz33SV6RdfMz2AHnf4ai62Vng2mN5GkaKahkooBIo9gA==", "license": "MIT" }, "node_modules/proxy-addr": { @@ -19818,14 +19819,14 @@ } }, "@babylonjs/core": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.42.0.tgz", - "integrity": "sha512-Jg8bJrTW4XgcB8tssIkvW8/M2uoVcbH662cYSn2/e5jim5SVbeS3hdbtk9t56s5MJnfJoOQgkz3+hFtWjM3Tmg==" + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.44.1.tgz", + "integrity": "sha512-sF2WWK2d7lg18ESOCxUoRG4d1SzCWz42asjRjRGxZ8r3D7w9ZM3H2wftJIqwaZvD3zWr+wmCVKpQ6hWkboHIXw==" }, "@babylonjs/gui": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.42.0.tgz", - "integrity": "sha512-Ayp0AhAKtPUDXrMFmgtP+PcQTQIlTkQfe20dXFakchSBBHvmoqNiBSwN7rN40XlJPps3pOaDuZsDoboJWkJxCQ==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.44.1.tgz", + "integrity": "sha512-6STDK+Hr8GpY29YMLKnTVhEnWw1NKPrIpz+MqgWuoAAmmpiFtNCr0nnAnCj5fhgGf25L89jy51ogXyg3jfiuDA==", "requires": {} }, "@babylonjs/havok": { @@ -19837,21 +19838,21 @@ } }, "@babylonjs/loaders": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.42.0.tgz", - "integrity": "sha512-sDthqDlgU7Nn4J/TcWFwsh8+ZJqp/tQtexLYlyDxs0VXInSwu9Hm1oCCCuKAdU/e9t4Qr5+ZpfnTDa4s0PcqBA==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.44.1.tgz", + "integrity": "sha512-h5rUGCwhdWv3Hq48DP8sy4/+3QUYjOprxu2i6zXKb69LHMnYE0tZ1xQHBJEOUF60hxA+TwhzdjC8bxInKoeojA==", "requires": {} }, "@babylonjs/materials": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.42.0.tgz", - "integrity": "sha512-fZsc+HWDlh4qrSeC2vfjmki4854V1o9NNIQvukZhkEoT8FsHqMaUUDn6EFRjrA1TBn4SU14uxTOPWrEGvMT/ag==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.44.1.tgz", + "integrity": "sha512-FD0S/aA68oEjKCSNY5ydGkiHbsyo08KlhQ+6R8swtJhx5aq7ojWBt3P9KC78+wjZiCJW37176CIObcV8QcjMAQ==", "requires": {} }, "@babylonjs/serializers": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.42.0.tgz", - "integrity": "sha512-VptrGNtGHn+hqpeev/ozJsPBrAn35s76rNZIdrmrLHIEJIWSo30IgNy4oZRNITcwqJ0H5Bv2r8QqBYZzQifPOg==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.44.1.tgz", + "integrity": "sha512-3FRRdKpHr2qTkALHEvq0ih0P59iTINUFrGZWFUfO3Wu24UBSuTxY9Kq820dvUUWaRtWkXEnMSQbR+5glzcfqBw==", "requires": {} }, "@bcoe/v8-coverage": { @@ -19860,45 +19861,45 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==" }, "@bitbybit-dev/babylonjs": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.14.tgz", - "integrity": "sha512-5V0HlvP8IZoTMSIaaafobWmFHnwf/nXKkQF2fvDNtw2urLFUJV08SVz8FggAjQTKZHNbmDp69ovJqQmEes7+HQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.21.0.tgz", + "integrity": "sha512-8aPJ+XTXzcnO4bXfmW34lTnVCzC6Hy6TMkh7/ziQSoUsjPp7e7LFHoBBfqCk09LdTLa85gb5x/f6WNAn306Odg==", "requires": { - "@babylonjs/core": "8.42.0", - "@babylonjs/gui": "8.42.0", + "@babylonjs/core": "8.44.1", + "@babylonjs/gui": "8.44.1", "@babylonjs/havok": "1.3.10", - "@babylonjs/loaders": "8.42.0", - "@babylonjs/materials": "8.42.0", - "@babylonjs/serializers": "8.42.0", - "@bitbybit-dev/core": "0.20.14", + "@babylonjs/loaders": "8.44.1", + "@babylonjs/materials": "8.44.1", + "@babylonjs/serializers": "8.44.1", + "@bitbybit-dev/core": "0.21.0", "earcut": "2.2.3" } }, "@bitbybit-dev/base": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.14.tgz", - "integrity": "sha512-Nv8eEwoVDU0Ug3TJIyzPtvIX03whvVIWsUw0xTkImFISUWmU0v1rNSaEd9FL9Rx7rMt2MC9Cxs3lXLkhZS3iAQ==" + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.21.0.tgz", + "integrity": "sha512-dNfsf2tu3/QUD1mvZzzTze8RwHyK2Jrt+Ary8EDKdNKMw+abtCpQYNerdrg0ZQPxvwu/OOQz6N1xCsCwsPkQJg==" }, "@bitbybit-dev/core": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.14.tgz", - "integrity": "sha512-meYYY5SEfoT+NEiM2W2lpwBWtFZzvRzrTcOuzDn/uNgmzyIqUARGYZroQgGEG9XmGiCUEfeYDc7Q7ML2aesyxg==", - "requires": { - "@bitbybit-dev/base": "0.20.14", - "@bitbybit-dev/jscad-worker": "0.20.14", - "@bitbybit-dev/manifold-worker": "0.20.14", - "@bitbybit-dev/occt-worker": "0.20.14", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.21.0.tgz", + "integrity": "sha512-IbeQ8ROreu0/RkkngUE+Eb19ecvqKOWhGefXvIqQmplxt3zEc0FI4Kw8wR3vYl2XMannuVt1xAIYtqqH0tjBzg==", + "requires": { + "@bitbybit-dev/base": "0.21.0", + "@bitbybit-dev/jscad-worker": "0.21.0", + "@bitbybit-dev/manifold-worker": "0.21.0", + "@bitbybit-dev/occt-worker": "0.21.0", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "@bitbybit-dev/jscad": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.14.tgz", - "integrity": "sha512-14paqSiCmYRkJxnaaSsY0X89Y9gi8NlWw/PCjtwh0Ds32W4pMbmee2i78ygVnds19qL4Gd1wje5UukVHqPVQTA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.21.0.tgz", + "integrity": "sha512-Q7eE2ILrJRstW4L1711aJZdpwPf1kuhZJqB+KLkkBLsneRsGsh82lBcCbVYAOMuF/q8Lnd4JHxPiIG/m+LYmPQ==", "requires": { - "@bitbybit-dev/base": "0.20.14", + "@bitbybit-dev/base": "0.21.0", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -19907,45 +19908,46 @@ } }, "@bitbybit-dev/jscad-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.14.tgz", - "integrity": "sha512-clF2kTptnZxMS2fWR+sjmnSiQ3OGF8mJYpsL4TqBdiewoIMR2IVmSoKunb0TzAucNdwsecc67gFv8OrXvW8ccA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.21.0.tgz", + "integrity": "sha512-nIvd7GH5Gg51u6PmFXOADXVYTIvixTkNf0YapS1uix7D2JS9Mx10Z4wHAeRKzvJxUAAbEPPRFNkakE22HFGtLQ==", "requires": { - "@bitbybit-dev/jscad": "0.20.14", + "@bitbybit-dev/jscad": "0.21.0", "rxjs": "7.5.5" } }, "@bitbybit-dev/manifold": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.14.tgz", - "integrity": "sha512-Cpe3P+LblDOIiyjCsMi/fAwlyOi7AGbhAoZMgGP7ItIKqf11yXXCSRTGF2daXYSPoUht1d86wLZdjProXyAOtQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.21.0.tgz", + "integrity": "sha512-DPpwK9ESB+auDeAbzXcfWRVEzWoMDkpkjc+/uwh+zuSiHSx92PSkzx1/LVTbQCsK+aOfOOy03HQCF5Bu2KQYtw==", "requires": { + "@bitbybit-dev/base": "0.21.0", "manifold-3d": "3.3.2" } }, "@bitbybit-dev/manifold-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.14.tgz", - "integrity": "sha512-o4yAo0BlxWRbv2vsg3G76QodkG3TOzMe7mWGvxeMJNvUrZTV01i9oDCOZudS9pU5lXMeSMpzRE56vbEInL8BqQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.21.0.tgz", + "integrity": "sha512-6Cqv3BP+uI8mHKHI6Jx9TzCxRg1/kMHhCe18+B3KD/rTl9B5mnScCKRBnDansR3bH7aYZGnIw9PmiFnWLkQWEQ==", "requires": { - "@bitbybit-dev/manifold": "0.20.14", + "@bitbybit-dev/manifold": "0.21.0", "rxjs": "7.5.5" } }, "@bitbybit-dev/occt": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.14.tgz", - "integrity": "sha512-f915HUNZd345OHbvxzNm+qOudDJ92akrUCUZooYLPSdSuDubNrXPan+ZwNofB1IACHuyCF/sheNc5t6zuEiy0A==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.21.0.tgz", + "integrity": "sha512-vPu3NmF1kBZMOkOdysolGfFxEEnwdHNGORoX3eWbMWT2JL/Tag5Q2CAc5jwa2VvZnS1nE/9x+DVlFQSo8LQnIg==", "requires": { - "@bitbybit-dev/base": "0.20.14" + "@bitbybit-dev/base": "0.21.0" } }, "@bitbybit-dev/occt-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.14.tgz", - "integrity": "sha512-0AmcXulDOikH/3cs64fbedZwZ+CgxJ6OyZvlPRUHyLXMPSmExMBh3QkImGOE+APL91QNKwBlWdDW/30IBtMQXQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.21.0.tgz", + "integrity": "sha512-xG1sgo6q/RdVA8AgG72wPe4qxcQlrO1V7/Ksn6MqIhZVTsJcm5RbVYlK+nziIWhvlMc1sKE0GNQFcPdALISLuQ==", "requires": { - "@bitbybit-dev/occt": "0.20.14", + "@bitbybit-dev/occt": "0.21.0", "rxjs": "7.5.5" } }, @@ -20076,9 +20078,9 @@ "requires": {} }, "@emnapi/runtime": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz", - "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz", + "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==", "optional": true, "requires": { "tslib": "^2.4.0" @@ -20243,29 +20245,29 @@ } }, "@gltf-transform/core": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.2.1.tgz", - "integrity": "sha512-qKhrQ29KJ9K6sz7xGoGRllqPBlROjPJMQPvCLBOfgMPH3S/Ph5E0e6fD5WmwTY5QPyBsDMRqKd1Vl0ncThTXGw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.3.0.tgz", + "integrity": "sha512-ZeaQfszGJ9LYwELszu45CuDQCsE26lJNNe36FVmN8xclaT6WDdCj7fwGpQXo0/l/YgAVAHX+uO7YNBW75/SRYw==", "requires": { - "property-graph": "^3.0.0" + "property-graph": "^4.0.0" } }, "@gltf-transform/extensions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.2.1.tgz", - "integrity": "sha512-ieHSJU9qvb3ucWDxgHFcff+C7fLtFPa6G0Wtc/ki7GsN6Rh7o9eoyqi7Ggj2LO4i3ynCwLLPb/onbJKw2fBtsA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.3.0.tgz", + "integrity": "sha512-XDAjQPYVMHa/VDpSbfCBwI+/1muwRJCaXhUpLgnUzAjn0D//PgvIAcbNm1EwBl3LIWBSwjDUCn2LiMAjp+aXVw==", "requires": { - "@gltf-transform/core": "^4.2.1", + "@gltf-transform/core": "^4.3.0", "ktx-parse": "^1.0.1" } }, "@gltf-transform/functions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.2.1.tgz", - "integrity": "sha512-hFCI80N6zt7yHlqXbzlYEYQbFwK+2OOZNvacrRtrWiCWKI0k1Ad5+nZFsmuIZZV03aXb5XG6UF7JINT3wETS1Q==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.3.0.tgz", + "integrity": "sha512-FZggHVgt3DHOezgESBrf2vDzuD2FYQYaNT2sT/aP316SIwhuiIwby3z7rhV9joDvWqqUaPkf1UmkjlOaY9riSQ==", "requires": { - "@gltf-transform/core": "^4.2.1", - "@gltf-transform/extensions": "^4.2.1", + "@gltf-transform/core": "^4.3.0", + "@gltf-transform/extensions": "^4.3.0", "ktx-parse": "^1.0.1", "ndarray": "^1.0.19", "ndarray-lanczos": "^0.3.0", @@ -22805,9 +22807,9 @@ } }, "babylonjs-gltf2interface": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.42.0.tgz", - "integrity": "sha512-PYYMVNATzo3yEesPh9b9tgp0/r3O6AXcBA6vc886Pk+XWYW9xiYwTe3B6pwJVsd/Zd12t2SBhDyBpWBqK8w8sw==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.44.1.tgz", + "integrity": "sha512-+z0P0wms1FD5xuVpuRJ1qjvGAbPAWhEWGBWENRPD0Hbz6nd9cnL28/pjxgk39/QhlIuJKL9JZ0o8G0JgLHEnRQ==", "peer": true }, "balanced-match": { @@ -29175,9 +29177,9 @@ } }, "property-graph": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-3.0.0.tgz", - "integrity": "sha512-TnzxUsttmGtw+OiU0LDw+0FlMbJ8vV8pOjyDI7+Kdni4Tj0hW5BFh7TatQu7Y68hcvvFmiFOHilKShsA4R82fA==" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-4.0.0.tgz", + "integrity": "sha512-I0hojAJfTbSCZy3y6xyK29eayxo14v1bj1VPiDkHjTdz33SV6RdfMz2AHnf4ai62Vng2mN5GkaKahkooBIo9gA==" }, "proxy-addr": { "version": "2.0.7", diff --git a/examples/react/babylonjs/cup/package.json b/examples/react/babylonjs/cup/package.json index c551f610..b6e0b454 100644 --- a/examples/react/babylonjs/cup/package.json +++ b/examples/react/babylonjs/cup/package.json @@ -4,7 +4,7 @@ "private": true, "homepage": "https://app-store.bitbybit.dev/cup", "dependencies": { - "@bitbybit-dev/babylonjs": "0.20.14", + "@bitbybit-dev/babylonjs": "0.21.0", "@emotion/react": "11.9.0", "@emotion/styled": "11.8.1", "web-ifc": "0.0.68", diff --git a/examples/react/babylonjs/laptop-holder/package-lock.json b/examples/react/babylonjs/laptop-holder/package-lock.json index 4b1dbc2c..8354f5e1 100644 --- a/examples/react/babylonjs/laptop-holder/package-lock.json +++ b/examples/react/babylonjs/laptop-holder/package-lock.json @@ -8,7 +8,7 @@ "name": "laptop-holder", "version": "0.1.0", "dependencies": { - "@bitbybit-dev/babylonjs": "0.20.14", + "@bitbybit-dev/babylonjs": "0.21.0", "@emotion/react": "11.9.0", "@emotion/styled": "11.8.1", "@mui/icons-material": "5.6.2", @@ -1847,15 +1847,15 @@ } }, "node_modules/@babylonjs/core": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.42.0.tgz", - "integrity": "sha512-Jg8bJrTW4XgcB8tssIkvW8/M2uoVcbH662cYSn2/e5jim5SVbeS3hdbtk9t56s5MJnfJoOQgkz3+hFtWjM3Tmg==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.44.1.tgz", + "integrity": "sha512-sF2WWK2d7lg18ESOCxUoRG4d1SzCWz42asjRjRGxZ8r3D7w9ZM3H2wftJIqwaZvD3zWr+wmCVKpQ6hWkboHIXw==", "license": "Apache-2.0" }, "node_modules/@babylonjs/gui": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.42.0.tgz", - "integrity": "sha512-Ayp0AhAKtPUDXrMFmgtP+PcQTQIlTkQfe20dXFakchSBBHvmoqNiBSwN7rN40XlJPps3pOaDuZsDoboJWkJxCQ==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.44.1.tgz", + "integrity": "sha512-6STDK+Hr8GpY29YMLKnTVhEnWw1NKPrIpz+MqgWuoAAmmpiFtNCr0nnAnCj5fhgGf25L89jy51ogXyg3jfiuDA==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0" @@ -1870,9 +1870,9 @@ } }, "node_modules/@babylonjs/loaders": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.42.0.tgz", - "integrity": "sha512-sDthqDlgU7Nn4J/TcWFwsh8+ZJqp/tQtexLYlyDxs0VXInSwu9Hm1oCCCuKAdU/e9t4Qr5+ZpfnTDa4s0PcqBA==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.44.1.tgz", + "integrity": "sha512-h5rUGCwhdWv3Hq48DP8sy4/+3QUYjOprxu2i6zXKb69LHMnYE0tZ1xQHBJEOUF60hxA+TwhzdjC8bxInKoeojA==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0", @@ -1880,18 +1880,18 @@ } }, "node_modules/@babylonjs/materials": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.42.0.tgz", - "integrity": "sha512-fZsc+HWDlh4qrSeC2vfjmki4854V1o9NNIQvukZhkEoT8FsHqMaUUDn6EFRjrA1TBn4SU14uxTOPWrEGvMT/ag==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.44.1.tgz", + "integrity": "sha512-FD0S/aA68oEjKCSNY5ydGkiHbsyo08KlhQ+6R8swtJhx5aq7ojWBt3P9KC78+wjZiCJW37176CIObcV8QcjMAQ==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.6.0" } }, "node_modules/@babylonjs/serializers": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.42.0.tgz", - "integrity": "sha512-VptrGNtGHn+hqpeev/ozJsPBrAn35s76rNZIdrmrLHIEJIWSo30IgNy4oZRNITcwqJ0H5Bv2r8QqBYZzQifPOg==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.44.1.tgz", + "integrity": "sha512-3FRRdKpHr2qTkALHEvq0ih0P59iTINUFrGZWFUfO3Wu24UBSuTxY9Kq820dvUUWaRtWkXEnMSQbR+5glzcfqBw==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0", @@ -1904,49 +1904,49 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==" }, "node_modules/@bitbybit-dev/babylonjs": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.14.tgz", - "integrity": "sha512-5V0HlvP8IZoTMSIaaafobWmFHnwf/nXKkQF2fvDNtw2urLFUJV08SVz8FggAjQTKZHNbmDp69ovJqQmEes7+HQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.21.0.tgz", + "integrity": "sha512-8aPJ+XTXzcnO4bXfmW34lTnVCzC6Hy6TMkh7/ziQSoUsjPp7e7LFHoBBfqCk09LdTLa85gb5x/f6WNAn306Odg==", "license": "MIT", "dependencies": { - "@babylonjs/core": "8.42.0", - "@babylonjs/gui": "8.42.0", + "@babylonjs/core": "8.44.1", + "@babylonjs/gui": "8.44.1", "@babylonjs/havok": "1.3.10", - "@babylonjs/loaders": "8.42.0", - "@babylonjs/materials": "8.42.0", - "@babylonjs/serializers": "8.42.0", - "@bitbybit-dev/core": "0.20.14", + "@babylonjs/loaders": "8.44.1", + "@babylonjs/materials": "8.44.1", + "@babylonjs/serializers": "8.44.1", + "@bitbybit-dev/core": "0.21.0", "earcut": "2.2.3" } }, "node_modules/@bitbybit-dev/base": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.14.tgz", - "integrity": "sha512-Nv8eEwoVDU0Ug3TJIyzPtvIX03whvVIWsUw0xTkImFISUWmU0v1rNSaEd9FL9Rx7rMt2MC9Cxs3lXLkhZS3iAQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.21.0.tgz", + "integrity": "sha512-dNfsf2tu3/QUD1mvZzzTze8RwHyK2Jrt+Ary8EDKdNKMw+abtCpQYNerdrg0ZQPxvwu/OOQz6N1xCsCwsPkQJg==", "license": "MIT" }, "node_modules/@bitbybit-dev/core": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.14.tgz", - "integrity": "sha512-meYYY5SEfoT+NEiM2W2lpwBWtFZzvRzrTcOuzDn/uNgmzyIqUARGYZroQgGEG9XmGiCUEfeYDc7Q7ML2aesyxg==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.21.0.tgz", + "integrity": "sha512-IbeQ8ROreu0/RkkngUE+Eb19ecvqKOWhGefXvIqQmplxt3zEc0FI4Kw8wR3vYl2XMannuVt1xAIYtqqH0tjBzg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14", - "@bitbybit-dev/jscad-worker": "0.20.14", - "@bitbybit-dev/manifold-worker": "0.20.14", - "@bitbybit-dev/occt-worker": "0.20.14", + "@bitbybit-dev/base": "0.21.0", + "@bitbybit-dev/jscad-worker": "0.21.0", + "@bitbybit-dev/manifold-worker": "0.21.0", + "@bitbybit-dev/occt-worker": "0.21.0", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "node_modules/@bitbybit-dev/jscad": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.14.tgz", - "integrity": "sha512-14paqSiCmYRkJxnaaSsY0X89Y9gi8NlWw/PCjtwh0Ds32W4pMbmee2i78ygVnds19qL4Gd1wje5UukVHqPVQTA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.21.0.tgz", + "integrity": "sha512-Q7eE2ILrJRstW4L1711aJZdpwPf1kuhZJqB+KLkkBLsneRsGsh82lBcCbVYAOMuF/q8Lnd4JHxPiIG/m+LYmPQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14", + "@bitbybit-dev/base": "0.21.0", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -1955,50 +1955,51 @@ } }, "node_modules/@bitbybit-dev/jscad-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.14.tgz", - "integrity": "sha512-clF2kTptnZxMS2fWR+sjmnSiQ3OGF8mJYpsL4TqBdiewoIMR2IVmSoKunb0TzAucNdwsecc67gFv8OrXvW8ccA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.21.0.tgz", + "integrity": "sha512-nIvd7GH5Gg51u6PmFXOADXVYTIvixTkNf0YapS1uix7D2JS9Mx10Z4wHAeRKzvJxUAAbEPPRFNkakE22HFGtLQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/jscad": "0.20.14", + "@bitbybit-dev/jscad": "0.21.0", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/manifold": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.14.tgz", - "integrity": "sha512-Cpe3P+LblDOIiyjCsMi/fAwlyOi7AGbhAoZMgGP7ItIKqf11yXXCSRTGF2daXYSPoUht1d86wLZdjProXyAOtQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.21.0.tgz", + "integrity": "sha512-DPpwK9ESB+auDeAbzXcfWRVEzWoMDkpkjc+/uwh+zuSiHSx92PSkzx1/LVTbQCsK+aOfOOy03HQCF5Bu2KQYtw==", "license": "MIT", "dependencies": { + "@bitbybit-dev/base": "0.21.0", "manifold-3d": "3.3.2" } }, "node_modules/@bitbybit-dev/manifold-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.14.tgz", - "integrity": "sha512-o4yAo0BlxWRbv2vsg3G76QodkG3TOzMe7mWGvxeMJNvUrZTV01i9oDCOZudS9pU5lXMeSMpzRE56vbEInL8BqQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.21.0.tgz", + "integrity": "sha512-6Cqv3BP+uI8mHKHI6Jx9TzCxRg1/kMHhCe18+B3KD/rTl9B5mnScCKRBnDansR3bH7aYZGnIw9PmiFnWLkQWEQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/manifold": "0.20.14", + "@bitbybit-dev/manifold": "0.21.0", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/occt": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.14.tgz", - "integrity": "sha512-f915HUNZd345OHbvxzNm+qOudDJ92akrUCUZooYLPSdSuDubNrXPan+ZwNofB1IACHuyCF/sheNc5t6zuEiy0A==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.21.0.tgz", + "integrity": "sha512-vPu3NmF1kBZMOkOdysolGfFxEEnwdHNGORoX3eWbMWT2JL/Tag5Q2CAc5jwa2VvZnS1nE/9x+DVlFQSo8LQnIg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14" + "@bitbybit-dev/base": "0.21.0" } }, "node_modules/@bitbybit-dev/occt-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.14.tgz", - "integrity": "sha512-0AmcXulDOikH/3cs64fbedZwZ+CgxJ6OyZvlPRUHyLXMPSmExMBh3QkImGOE+APL91QNKwBlWdDW/30IBtMQXQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.21.0.tgz", + "integrity": "sha512-xG1sgo6q/RdVA8AgG72wPe4qxcQlrO1V7/Ksn6MqIhZVTsJcm5RbVYlK+nziIWhvlMc1sKE0GNQFcPdALISLuQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/occt": "0.20.14", + "@bitbybit-dev/occt": "0.21.0", "rxjs": "7.5.5" } }, @@ -2123,9 +2124,9 @@ } }, "node_modules/@emnapi/runtime": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz", - "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz", + "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==", "license": "MIT", "optional": true, "dependencies": { @@ -2364,24 +2365,24 @@ } }, "node_modules/@gltf-transform/core": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.2.1.tgz", - "integrity": "sha512-qKhrQ29KJ9K6sz7xGoGRllqPBlROjPJMQPvCLBOfgMPH3S/Ph5E0e6fD5WmwTY5QPyBsDMRqKd1Vl0ncThTXGw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.3.0.tgz", + "integrity": "sha512-ZeaQfszGJ9LYwELszu45CuDQCsE26lJNNe36FVmN8xclaT6WDdCj7fwGpQXo0/l/YgAVAHX+uO7YNBW75/SRYw==", "license": "MIT", "dependencies": { - "property-graph": "^3.0.0" + "property-graph": "^4.0.0" }, "funding": { "url": "https://github.com/sponsors/donmccurdy" } }, "node_modules/@gltf-transform/extensions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.2.1.tgz", - "integrity": "sha512-ieHSJU9qvb3ucWDxgHFcff+C7fLtFPa6G0Wtc/ki7GsN6Rh7o9eoyqi7Ggj2LO4i3ynCwLLPb/onbJKw2fBtsA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.3.0.tgz", + "integrity": "sha512-XDAjQPYVMHa/VDpSbfCBwI+/1muwRJCaXhUpLgnUzAjn0D//PgvIAcbNm1EwBl3LIWBSwjDUCn2LiMAjp+aXVw==", "license": "MIT", "dependencies": { - "@gltf-transform/core": "^4.2.1", + "@gltf-transform/core": "^4.3.0", "ktx-parse": "^1.0.1" }, "funding": { @@ -2389,13 +2390,13 @@ } }, "node_modules/@gltf-transform/functions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.2.1.tgz", - "integrity": "sha512-hFCI80N6zt7yHlqXbzlYEYQbFwK+2OOZNvacrRtrWiCWKI0k1Ad5+nZFsmuIZZV03aXb5XG6UF7JINT3wETS1Q==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.3.0.tgz", + "integrity": "sha512-FZggHVgt3DHOezgESBrf2vDzuD2FYQYaNT2sT/aP316SIwhuiIwby3z7rhV9joDvWqqUaPkf1UmkjlOaY9riSQ==", "license": "MIT", "dependencies": { - "@gltf-transform/core": "^4.2.1", - "@gltf-transform/extensions": "^4.2.1", + "@gltf-transform/core": "^4.3.0", + "@gltf-transform/extensions": "^4.3.0", "ktx-parse": "^1.0.1", "ndarray": "^1.0.19", "ndarray-lanczos": "^0.3.0", @@ -5932,9 +5933,9 @@ } }, "node_modules/babylonjs-gltf2interface": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.42.0.tgz", - "integrity": "sha512-PYYMVNATzo3yEesPh9b9tgp0/r3O6AXcBA6vc886Pk+XWYW9xiYwTe3B6pwJVsd/Zd12t2SBhDyBpWBqK8w8sw==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.44.1.tgz", + "integrity": "sha512-+z0P0wms1FD5xuVpuRJ1qjvGAbPAWhEWGBWENRPD0Hbz6nd9cnL28/pjxgk39/QhlIuJKL9JZ0o8G0JgLHEnRQ==", "license": "Apache-2.0", "peer": true }, @@ -14374,9 +14375,9 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, "node_modules/property-graph": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-3.0.0.tgz", - "integrity": "sha512-TnzxUsttmGtw+OiU0LDw+0FlMbJ8vV8pOjyDI7+Kdni4Tj0hW5BFh7TatQu7Y68hcvvFmiFOHilKShsA4R82fA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-4.0.0.tgz", + "integrity": "sha512-I0hojAJfTbSCZy3y6xyK29eayxo14v1bj1VPiDkHjTdz33SV6RdfMz2AHnf4ai62Vng2mN5GkaKahkooBIo9gA==", "license": "MIT" }, "node_modules/proxy-addr": { @@ -18896,14 +18897,14 @@ } }, "@babylonjs/core": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.42.0.tgz", - "integrity": "sha512-Jg8bJrTW4XgcB8tssIkvW8/M2uoVcbH662cYSn2/e5jim5SVbeS3hdbtk9t56s5MJnfJoOQgkz3+hFtWjM3Tmg==" + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.44.1.tgz", + "integrity": "sha512-sF2WWK2d7lg18ESOCxUoRG4d1SzCWz42asjRjRGxZ8r3D7w9ZM3H2wftJIqwaZvD3zWr+wmCVKpQ6hWkboHIXw==" }, "@babylonjs/gui": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.42.0.tgz", - "integrity": "sha512-Ayp0AhAKtPUDXrMFmgtP+PcQTQIlTkQfe20dXFakchSBBHvmoqNiBSwN7rN40XlJPps3pOaDuZsDoboJWkJxCQ==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.44.1.tgz", + "integrity": "sha512-6STDK+Hr8GpY29YMLKnTVhEnWw1NKPrIpz+MqgWuoAAmmpiFtNCr0nnAnCj5fhgGf25L89jy51ogXyg3jfiuDA==", "requires": {} }, "@babylonjs/havok": { @@ -18915,21 +18916,21 @@ } }, "@babylonjs/loaders": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.42.0.tgz", - "integrity": "sha512-sDthqDlgU7Nn4J/TcWFwsh8+ZJqp/tQtexLYlyDxs0VXInSwu9Hm1oCCCuKAdU/e9t4Qr5+ZpfnTDa4s0PcqBA==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.44.1.tgz", + "integrity": "sha512-h5rUGCwhdWv3Hq48DP8sy4/+3QUYjOprxu2i6zXKb69LHMnYE0tZ1xQHBJEOUF60hxA+TwhzdjC8bxInKoeojA==", "requires": {} }, "@babylonjs/materials": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.42.0.tgz", - "integrity": "sha512-fZsc+HWDlh4qrSeC2vfjmki4854V1o9NNIQvukZhkEoT8FsHqMaUUDn6EFRjrA1TBn4SU14uxTOPWrEGvMT/ag==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.44.1.tgz", + "integrity": "sha512-FD0S/aA68oEjKCSNY5ydGkiHbsyo08KlhQ+6R8swtJhx5aq7ojWBt3P9KC78+wjZiCJW37176CIObcV8QcjMAQ==", "requires": {} }, "@babylonjs/serializers": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.42.0.tgz", - "integrity": "sha512-VptrGNtGHn+hqpeev/ozJsPBrAn35s76rNZIdrmrLHIEJIWSo30IgNy4oZRNITcwqJ0H5Bv2r8QqBYZzQifPOg==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.44.1.tgz", + "integrity": "sha512-3FRRdKpHr2qTkALHEvq0ih0P59iTINUFrGZWFUfO3Wu24UBSuTxY9Kq820dvUUWaRtWkXEnMSQbR+5glzcfqBw==", "requires": {} }, "@bcoe/v8-coverage": { @@ -18938,45 +18939,45 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==" }, "@bitbybit-dev/babylonjs": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.14.tgz", - "integrity": "sha512-5V0HlvP8IZoTMSIaaafobWmFHnwf/nXKkQF2fvDNtw2urLFUJV08SVz8FggAjQTKZHNbmDp69ovJqQmEes7+HQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.21.0.tgz", + "integrity": "sha512-8aPJ+XTXzcnO4bXfmW34lTnVCzC6Hy6TMkh7/ziQSoUsjPp7e7LFHoBBfqCk09LdTLa85gb5x/f6WNAn306Odg==", "requires": { - "@babylonjs/core": "8.42.0", - "@babylonjs/gui": "8.42.0", + "@babylonjs/core": "8.44.1", + "@babylonjs/gui": "8.44.1", "@babylonjs/havok": "1.3.10", - "@babylonjs/loaders": "8.42.0", - "@babylonjs/materials": "8.42.0", - "@babylonjs/serializers": "8.42.0", - "@bitbybit-dev/core": "0.20.14", + "@babylonjs/loaders": "8.44.1", + "@babylonjs/materials": "8.44.1", + "@babylonjs/serializers": "8.44.1", + "@bitbybit-dev/core": "0.21.0", "earcut": "2.2.3" } }, "@bitbybit-dev/base": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.14.tgz", - "integrity": "sha512-Nv8eEwoVDU0Ug3TJIyzPtvIX03whvVIWsUw0xTkImFISUWmU0v1rNSaEd9FL9Rx7rMt2MC9Cxs3lXLkhZS3iAQ==" + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.21.0.tgz", + "integrity": "sha512-dNfsf2tu3/QUD1mvZzzTze8RwHyK2Jrt+Ary8EDKdNKMw+abtCpQYNerdrg0ZQPxvwu/OOQz6N1xCsCwsPkQJg==" }, "@bitbybit-dev/core": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.14.tgz", - "integrity": "sha512-meYYY5SEfoT+NEiM2W2lpwBWtFZzvRzrTcOuzDn/uNgmzyIqUARGYZroQgGEG9XmGiCUEfeYDc7Q7ML2aesyxg==", - "requires": { - "@bitbybit-dev/base": "0.20.14", - "@bitbybit-dev/jscad-worker": "0.20.14", - "@bitbybit-dev/manifold-worker": "0.20.14", - "@bitbybit-dev/occt-worker": "0.20.14", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.21.0.tgz", + "integrity": "sha512-IbeQ8ROreu0/RkkngUE+Eb19ecvqKOWhGefXvIqQmplxt3zEc0FI4Kw8wR3vYl2XMannuVt1xAIYtqqH0tjBzg==", + "requires": { + "@bitbybit-dev/base": "0.21.0", + "@bitbybit-dev/jscad-worker": "0.21.0", + "@bitbybit-dev/manifold-worker": "0.21.0", + "@bitbybit-dev/occt-worker": "0.21.0", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "@bitbybit-dev/jscad": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.14.tgz", - "integrity": "sha512-14paqSiCmYRkJxnaaSsY0X89Y9gi8NlWw/PCjtwh0Ds32W4pMbmee2i78ygVnds19qL4Gd1wje5UukVHqPVQTA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.21.0.tgz", + "integrity": "sha512-Q7eE2ILrJRstW4L1711aJZdpwPf1kuhZJqB+KLkkBLsneRsGsh82lBcCbVYAOMuF/q8Lnd4JHxPiIG/m+LYmPQ==", "requires": { - "@bitbybit-dev/base": "0.20.14", + "@bitbybit-dev/base": "0.21.0", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -18985,45 +18986,46 @@ } }, "@bitbybit-dev/jscad-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.14.tgz", - "integrity": "sha512-clF2kTptnZxMS2fWR+sjmnSiQ3OGF8mJYpsL4TqBdiewoIMR2IVmSoKunb0TzAucNdwsecc67gFv8OrXvW8ccA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.21.0.tgz", + "integrity": "sha512-nIvd7GH5Gg51u6PmFXOADXVYTIvixTkNf0YapS1uix7D2JS9Mx10Z4wHAeRKzvJxUAAbEPPRFNkakE22HFGtLQ==", "requires": { - "@bitbybit-dev/jscad": "0.20.14", + "@bitbybit-dev/jscad": "0.21.0", "rxjs": "7.5.5" } }, "@bitbybit-dev/manifold": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.14.tgz", - "integrity": "sha512-Cpe3P+LblDOIiyjCsMi/fAwlyOi7AGbhAoZMgGP7ItIKqf11yXXCSRTGF2daXYSPoUht1d86wLZdjProXyAOtQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.21.0.tgz", + "integrity": "sha512-DPpwK9ESB+auDeAbzXcfWRVEzWoMDkpkjc+/uwh+zuSiHSx92PSkzx1/LVTbQCsK+aOfOOy03HQCF5Bu2KQYtw==", "requires": { + "@bitbybit-dev/base": "0.21.0", "manifold-3d": "3.3.2" } }, "@bitbybit-dev/manifold-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.14.tgz", - "integrity": "sha512-o4yAo0BlxWRbv2vsg3G76QodkG3TOzMe7mWGvxeMJNvUrZTV01i9oDCOZudS9pU5lXMeSMpzRE56vbEInL8BqQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.21.0.tgz", + "integrity": "sha512-6Cqv3BP+uI8mHKHI6Jx9TzCxRg1/kMHhCe18+B3KD/rTl9B5mnScCKRBnDansR3bH7aYZGnIw9PmiFnWLkQWEQ==", "requires": { - "@bitbybit-dev/manifold": "0.20.14", + "@bitbybit-dev/manifold": "0.21.0", "rxjs": "7.5.5" } }, "@bitbybit-dev/occt": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.14.tgz", - "integrity": "sha512-f915HUNZd345OHbvxzNm+qOudDJ92akrUCUZooYLPSdSuDubNrXPan+ZwNofB1IACHuyCF/sheNc5t6zuEiy0A==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.21.0.tgz", + "integrity": "sha512-vPu3NmF1kBZMOkOdysolGfFxEEnwdHNGORoX3eWbMWT2JL/Tag5Q2CAc5jwa2VvZnS1nE/9x+DVlFQSo8LQnIg==", "requires": { - "@bitbybit-dev/base": "0.20.14" + "@bitbybit-dev/base": "0.21.0" } }, "@bitbybit-dev/occt-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.14.tgz", - "integrity": "sha512-0AmcXulDOikH/3cs64fbedZwZ+CgxJ6OyZvlPRUHyLXMPSmExMBh3QkImGOE+APL91QNKwBlWdDW/30IBtMQXQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.21.0.tgz", + "integrity": "sha512-xG1sgo6q/RdVA8AgG72wPe4qxcQlrO1V7/Ksn6MqIhZVTsJcm5RbVYlK+nziIWhvlMc1sKE0GNQFcPdALISLuQ==", "requires": { - "@bitbybit-dev/occt": "0.20.14", + "@bitbybit-dev/occt": "0.21.0", "rxjs": "7.5.5" } }, @@ -19100,9 +19102,9 @@ } }, "@emnapi/runtime": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz", - "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz", + "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==", "optional": true, "requires": { "tslib": "^2.4.0" @@ -19289,29 +19291,29 @@ } }, "@gltf-transform/core": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.2.1.tgz", - "integrity": "sha512-qKhrQ29KJ9K6sz7xGoGRllqPBlROjPJMQPvCLBOfgMPH3S/Ph5E0e6fD5WmwTY5QPyBsDMRqKd1Vl0ncThTXGw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.3.0.tgz", + "integrity": "sha512-ZeaQfszGJ9LYwELszu45CuDQCsE26lJNNe36FVmN8xclaT6WDdCj7fwGpQXo0/l/YgAVAHX+uO7YNBW75/SRYw==", "requires": { - "property-graph": "^3.0.0" + "property-graph": "^4.0.0" } }, "@gltf-transform/extensions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.2.1.tgz", - "integrity": "sha512-ieHSJU9qvb3ucWDxgHFcff+C7fLtFPa6G0Wtc/ki7GsN6Rh7o9eoyqi7Ggj2LO4i3ynCwLLPb/onbJKw2fBtsA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.3.0.tgz", + "integrity": "sha512-XDAjQPYVMHa/VDpSbfCBwI+/1muwRJCaXhUpLgnUzAjn0D//PgvIAcbNm1EwBl3LIWBSwjDUCn2LiMAjp+aXVw==", "requires": { - "@gltf-transform/core": "^4.2.1", + "@gltf-transform/core": "^4.3.0", "ktx-parse": "^1.0.1" } }, "@gltf-transform/functions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.2.1.tgz", - "integrity": "sha512-hFCI80N6zt7yHlqXbzlYEYQbFwK+2OOZNvacrRtrWiCWKI0k1Ad5+nZFsmuIZZV03aXb5XG6UF7JINT3wETS1Q==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.3.0.tgz", + "integrity": "sha512-FZggHVgt3DHOezgESBrf2vDzuD2FYQYaNT2sT/aP316SIwhuiIwby3z7rhV9joDvWqqUaPkf1UmkjlOaY9riSQ==", "requires": { - "@gltf-transform/core": "^4.2.1", - "@gltf-transform/extensions": "^4.2.1", + "@gltf-transform/core": "^4.3.0", + "@gltf-transform/extensions": "^4.3.0", "ktx-parse": "^1.0.1", "ndarray": "^1.0.19", "ndarray-lanczos": "^0.3.0", @@ -21686,9 +21688,9 @@ } }, "babylonjs-gltf2interface": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.42.0.tgz", - "integrity": "sha512-PYYMVNATzo3yEesPh9b9tgp0/r3O6AXcBA6vc886Pk+XWYW9xiYwTe3B6pwJVsd/Zd12t2SBhDyBpWBqK8w8sw==", + "version": "8.44.1", + "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.44.1.tgz", + "integrity": "sha512-+z0P0wms1FD5xuVpuRJ1qjvGAbPAWhEWGBWENRPD0Hbz6nd9cnL28/pjxgk39/QhlIuJKL9JZ0o8G0JgLHEnRQ==", "peer": true }, "balanced-match": { @@ -27686,9 +27688,9 @@ } }, "property-graph": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-3.0.0.tgz", - "integrity": "sha512-TnzxUsttmGtw+OiU0LDw+0FlMbJ8vV8pOjyDI7+Kdni4Tj0hW5BFh7TatQu7Y68hcvvFmiFOHilKShsA4R82fA==" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-4.0.0.tgz", + "integrity": "sha512-I0hojAJfTbSCZy3y6xyK29eayxo14v1bj1VPiDkHjTdz33SV6RdfMz2AHnf4ai62Vng2mN5GkaKahkooBIo9gA==" }, "proxy-addr": { "version": "2.0.7", diff --git a/examples/react/babylonjs/laptop-holder/package.json b/examples/react/babylonjs/laptop-holder/package.json index c2715c54..4935f85f 100644 --- a/examples/react/babylonjs/laptop-holder/package.json +++ b/examples/react/babylonjs/laptop-holder/package.json @@ -16,7 +16,7 @@ "react-scripts": "5.0.1", "typescript": "^4.6.2", "web-vitals": "^2.1.4", - "@bitbybit-dev/babylonjs": "0.20.14", + "@bitbybit-dev/babylonjs": "0.21.0", "file-loader": "6.2.0", "@mui/icons-material": "5.6.2", "@mui/material": "5.6.4", diff --git a/examples/react/threejs/vase/package-lock.json b/examples/react/threejs/vase/package-lock.json index 5c6fd964..6fff5bd8 100644 --- a/examples/react/threejs/vase/package-lock.json +++ b/examples/react/threejs/vase/package-lock.json @@ -9,7 +9,7 @@ "version": "0.1.0", "dependencies": { "@babel/plugin-proposal-private-property-in-object": "7.21.11", - "@bitbybit-dev/threejs": "0.20.14", + "@bitbybit-dev/threejs": "0.21.0", "@emotion/react": "11.11.0", "@emotion/styled": "11.11.0", "@mui/icons-material": "5.11.16", @@ -1995,33 +1995,33 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==" }, "node_modules/@bitbybit-dev/base": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.14.tgz", - "integrity": "sha512-Nv8eEwoVDU0Ug3TJIyzPtvIX03whvVIWsUw0xTkImFISUWmU0v1rNSaEd9FL9Rx7rMt2MC9Cxs3lXLkhZS3iAQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.21.0.tgz", + "integrity": "sha512-dNfsf2tu3/QUD1mvZzzTze8RwHyK2Jrt+Ary8EDKdNKMw+abtCpQYNerdrg0ZQPxvwu/OOQz6N1xCsCwsPkQJg==", "license": "MIT" }, "node_modules/@bitbybit-dev/core": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.14.tgz", - "integrity": "sha512-meYYY5SEfoT+NEiM2W2lpwBWtFZzvRzrTcOuzDn/uNgmzyIqUARGYZroQgGEG9XmGiCUEfeYDc7Q7ML2aesyxg==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.21.0.tgz", + "integrity": "sha512-IbeQ8ROreu0/RkkngUE+Eb19ecvqKOWhGefXvIqQmplxt3zEc0FI4Kw8wR3vYl2XMannuVt1xAIYtqqH0tjBzg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14", - "@bitbybit-dev/jscad-worker": "0.20.14", - "@bitbybit-dev/manifold-worker": "0.20.14", - "@bitbybit-dev/occt-worker": "0.20.14", + "@bitbybit-dev/base": "0.21.0", + "@bitbybit-dev/jscad-worker": "0.21.0", + "@bitbybit-dev/manifold-worker": "0.21.0", + "@bitbybit-dev/occt-worker": "0.21.0", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "node_modules/@bitbybit-dev/jscad": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.14.tgz", - "integrity": "sha512-14paqSiCmYRkJxnaaSsY0X89Y9gi8NlWw/PCjtwh0Ds32W4pMbmee2i78ygVnds19qL4Gd1wje5UukVHqPVQTA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.21.0.tgz", + "integrity": "sha512-Q7eE2ILrJRstW4L1711aJZdpwPf1kuhZJqB+KLkkBLsneRsGsh82lBcCbVYAOMuF/q8Lnd4JHxPiIG/m+LYmPQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14", + "@bitbybit-dev/base": "0.21.0", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -2030,60 +2030,61 @@ } }, "node_modules/@bitbybit-dev/jscad-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.14.tgz", - "integrity": "sha512-clF2kTptnZxMS2fWR+sjmnSiQ3OGF8mJYpsL4TqBdiewoIMR2IVmSoKunb0TzAucNdwsecc67gFv8OrXvW8ccA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.21.0.tgz", + "integrity": "sha512-nIvd7GH5Gg51u6PmFXOADXVYTIvixTkNf0YapS1uix7D2JS9Mx10Z4wHAeRKzvJxUAAbEPPRFNkakE22HFGtLQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/jscad": "0.20.14", + "@bitbybit-dev/jscad": "0.21.0", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/manifold": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.14.tgz", - "integrity": "sha512-Cpe3P+LblDOIiyjCsMi/fAwlyOi7AGbhAoZMgGP7ItIKqf11yXXCSRTGF2daXYSPoUht1d86wLZdjProXyAOtQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.21.0.tgz", + "integrity": "sha512-DPpwK9ESB+auDeAbzXcfWRVEzWoMDkpkjc+/uwh+zuSiHSx92PSkzx1/LVTbQCsK+aOfOOy03HQCF5Bu2KQYtw==", "license": "MIT", "dependencies": { + "@bitbybit-dev/base": "0.21.0", "manifold-3d": "3.3.2" } }, "node_modules/@bitbybit-dev/manifold-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.14.tgz", - "integrity": "sha512-o4yAo0BlxWRbv2vsg3G76QodkG3TOzMe7mWGvxeMJNvUrZTV01i9oDCOZudS9pU5lXMeSMpzRE56vbEInL8BqQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.21.0.tgz", + "integrity": "sha512-6Cqv3BP+uI8mHKHI6Jx9TzCxRg1/kMHhCe18+B3KD/rTl9B5mnScCKRBnDansR3bH7aYZGnIw9PmiFnWLkQWEQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/manifold": "0.20.14", + "@bitbybit-dev/manifold": "0.21.0", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/occt": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.14.tgz", - "integrity": "sha512-f915HUNZd345OHbvxzNm+qOudDJ92akrUCUZooYLPSdSuDubNrXPan+ZwNofB1IACHuyCF/sheNc5t6zuEiy0A==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.21.0.tgz", + "integrity": "sha512-vPu3NmF1kBZMOkOdysolGfFxEEnwdHNGORoX3eWbMWT2JL/Tag5Q2CAc5jwa2VvZnS1nE/9x+DVlFQSo8LQnIg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.14" + "@bitbybit-dev/base": "0.21.0" } }, "node_modules/@bitbybit-dev/occt-worker": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.14.tgz", - "integrity": "sha512-0AmcXulDOikH/3cs64fbedZwZ+CgxJ6OyZvlPRUHyLXMPSmExMBh3QkImGOE+APL91QNKwBlWdDW/30IBtMQXQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.21.0.tgz", + "integrity": "sha512-xG1sgo6q/RdVA8AgG72wPe4qxcQlrO1V7/Ksn6MqIhZVTsJcm5RbVYlK+nziIWhvlMc1sKE0GNQFcPdALISLuQ==", "license": "MIT", "dependencies": { - "@bitbybit-dev/occt": "0.20.14", + "@bitbybit-dev/occt": "0.21.0", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/threejs": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/threejs/-/threejs-0.20.14.tgz", - "integrity": "sha512-2vb552Yoz0QM+R268k5F7SwZrzV8JQb71xxkzxqwl3VmvZl2yFQJBDUpeiIQF2N5iyKfgIuiM7LXzZYdCaY4PQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/threejs/-/threejs-0.21.0.tgz", + "integrity": "sha512-p0fHuLTjoXs3UIWoC2TFUBAhu0F4sTPU//PCvwwPLmLrbrVmpEFV61tGs0739hbU4eKS5goCTUM99RfjbRxW6A==", "license": "MIT", "dependencies": { - "@bitbybit-dev/core": "0.20.14", + "@bitbybit-dev/core": "0.21.0", "three": "0.182.0" } }, @@ -2363,9 +2364,9 @@ "integrity": "sha512-uekIGetywIgopfD97oDL5PfeezkFpNhwlzlaEYNOA0N6ghdsOvh/HYjSMek5Q2O1PYvRSDFcqFVJl4r4ZBwOow==" }, "node_modules/@emnapi/runtime": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz", - "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz", + "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==", "license": "MIT", "optional": true, "dependencies": { @@ -2607,24 +2608,24 @@ } }, "node_modules/@gltf-transform/core": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.2.1.tgz", - "integrity": "sha512-qKhrQ29KJ9K6sz7xGoGRllqPBlROjPJMQPvCLBOfgMPH3S/Ph5E0e6fD5WmwTY5QPyBsDMRqKd1Vl0ncThTXGw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.3.0.tgz", + "integrity": "sha512-ZeaQfszGJ9LYwELszu45CuDQCsE26lJNNe36FVmN8xclaT6WDdCj7fwGpQXo0/l/YgAVAHX+uO7YNBW75/SRYw==", "license": "MIT", "dependencies": { - "property-graph": "^3.0.0" + "property-graph": "^4.0.0" }, "funding": { "url": "https://github.com/sponsors/donmccurdy" } }, "node_modules/@gltf-transform/extensions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.2.1.tgz", - "integrity": "sha512-ieHSJU9qvb3ucWDxgHFcff+C7fLtFPa6G0Wtc/ki7GsN6Rh7o9eoyqi7Ggj2LO4i3ynCwLLPb/onbJKw2fBtsA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.3.0.tgz", + "integrity": "sha512-XDAjQPYVMHa/VDpSbfCBwI+/1muwRJCaXhUpLgnUzAjn0D//PgvIAcbNm1EwBl3LIWBSwjDUCn2LiMAjp+aXVw==", "license": "MIT", "dependencies": { - "@gltf-transform/core": "^4.2.1", + "@gltf-transform/core": "^4.3.0", "ktx-parse": "^1.0.1" }, "funding": { @@ -2632,13 +2633,13 @@ } }, "node_modules/@gltf-transform/functions": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.2.1.tgz", - "integrity": "sha512-hFCI80N6zt7yHlqXbzlYEYQbFwK+2OOZNvacrRtrWiCWKI0k1Ad5+nZFsmuIZZV03aXb5XG6UF7JINT3wETS1Q==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.3.0.tgz", + "integrity": "sha512-FZggHVgt3DHOezgESBrf2vDzuD2FYQYaNT2sT/aP316SIwhuiIwby3z7rhV9joDvWqqUaPkf1UmkjlOaY9riSQ==", "license": "MIT", "dependencies": { - "@gltf-transform/core": "^4.2.1", - "@gltf-transform/extensions": "^4.2.1", + "@gltf-transform/core": "^4.3.0", + "@gltf-transform/extensions": "^4.3.0", "ktx-parse": "^1.0.1", "ndarray": "^1.0.19", "ndarray-lanczos": "^0.3.0", @@ -15532,9 +15533,9 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, "node_modules/property-graph": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-3.0.0.tgz", - "integrity": "sha512-TnzxUsttmGtw+OiU0LDw+0FlMbJ8vV8pOjyDI7+Kdni4Tj0hW5BFh7TatQu7Y68hcvvFmiFOHilKShsA4R82fA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-4.0.0.tgz", + "integrity": "sha512-I0hojAJfTbSCZy3y6xyK29eayxo14v1bj1VPiDkHjTdz33SV6RdfMz2AHnf4ai62Vng2mN5GkaKahkooBIo9gA==", "license": "MIT" }, "node_modules/proxy-addr": { diff --git a/examples/react/threejs/vase/package.json b/examples/react/threejs/vase/package.json index 43d4f201..0356dbca 100644 --- a/examples/react/threejs/vase/package.json +++ b/examples/react/threejs/vase/package.json @@ -4,7 +4,7 @@ "private": true, "homepage": "https://app-store.bitbybit.dev/bitbybit-threejs", "dependencies": { - "@bitbybit-dev/threejs": "0.20.14", + "@bitbybit-dev/threejs": "0.21.0", "@testing-library/jest-dom": "5.16.5", "@testing-library/react": "14.0.0", "@testing-library/user-event": "14.4.3", diff --git a/examples/runner/babylon/full/inline-include/index.html b/examples/runner/babylon/full/inline-include/index.html index 7ebd92b8..fd54a69b 100644 --- a/examples/runner/babylon/full/inline-include/index.html +++ b/examples/runner/babylon/full/inline-include/index.html @@ -34,7 +34,7 @@ // This function simply outputs the script that was exported from the Rete editor by clicking "Export to Runner" and selecting Minify option. function exportedScript() { - return '{\"type\":\"rete\",\"version\":\"0.20.14\",\"script\":\"!async function(e,t,s,n,r){let a={};a={x:[0],y:[0],z:[1],...a};const o=[{result:e.HS.executeBasedOnType(a,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let i={};i={text:[\\"[true,false]\\"],...i};const c=[{result:e.HS.executeBasedOnType(i,!1,(e=>t.json.parse(e))),transformers:[]}];let p={};p={text:[\\"[false,true]\\"],...p};const u=[{result:e.HS.executeBasedOnType(p,!1,(e=>t.json.parse(e))),transformers:[]}],l=[{result:[5],transformers:[]}];let d={};d={x:[1],y:[0],z:[0],...d};const m=[{result:e.HS.executeBasedOnType(d,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}],y=[{result:[12],transformers:[]}],S=[{result:[7],transformers:[]}];let H={};H={x:[0],y:[1],z:[0],...H};const f=[{result:e.HS.executeBasedOnType(H,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let h={};h={x:[0],y:[0],z:[1],...h};const x=[{result:e.HS.executeBasedOnType(h,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let v={};v={number:[.4],...v};const O=[{result:e.HS.executeBasedOnType(v,!1,(e=>t.math.number(e))),transformers:[]}];let I={};I={x:[0],y:[0],z:[-1],...I};const L=[{result:e.HS.executeBasedOnType(I,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let B={};B={x:[0],y:[0],z:[-2],...B};const w=[{result:e.HS.executeBasedOnType(B,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let T={};T={x:[0],y:[0],z:[1],...T};const g=[{result:e.HS.executeBasedOnType(T,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let A={};A={x:[0],y:[1.5],z:[0],...A};const E=[{result:e.HS.executeBasedOnType(A,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let b={};b={...{faceOpacity:[.5],edgeOpacity:[.5],edgeColour:[\\"#000000\\"],faceColour:[\\"#212121\\"],vertexColour:[\\"#ff00ff\\"],faceMaterial:[void 0],edgeWidth:[2],vertexSize:[.03],drawEdges:[!0],drawFaces:[!0],drawVertices:[!1],precision:[.02],drawEdgeIndexes:[!1],edgeIndexHeight:[.06],edgeIndexColour:[\\"ff00ff\\"],drawFaceIndexes:[!1],faceIndexHeight:[.06],faceIndexColour:[\\"#0000ff\\"]},...b};const z=[{result:e.HS.executeBasedOnType(b,!1,(e=>t.draw.optionsOcctShape(e))),transformers:[]}];let W={};W={name:[\\"Custom Material\\"],baseColor:[\\"#9c9cba\\"],emissiveColor:[\\"#000000\\"],metallic:[.9],roughness:[.1],alpha:[1],backFaceCulling:[!1],zOffset:[2],...W};const C=[{result:e.HS.executeBasedOnType(W,!1,(e=>t.babylon.material.pbrMetallicRoughness.create(e))),transformers:[]}];let P={};P={x:[0],y:[0],z:[-1],...P};const X=[{result:e.HS.executeBasedOnType(P,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Y={};Y={x:[0],y:[0],z:[-1.5],...Y};const Z=[{result:e.HS.executeBasedOnType(Y,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let N={};N={x:[0],y:[0],z:[1],...N};const k=[{result:e.HS.executeBasedOnType(N,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let M={};M={skybox:[\\"city\\"],size:[1e3],blur:[.4],environmentIntensity:[.4],...M};e.HS.executeBasedOnType(M,!1,(e=>t.babylon.scene.enableSkybox(e)));let F={number:[{result:[20],transformers:[]}]};e.HS.updateListInputs(F),F={number:[20],...F};const D=[{result:e.HS.executeBasedOnType(F,!1,(e=>t.math.number(e))),transformers:[]}];let R={};R.y=y,e.HS.updateListInputs(R),R={x:[0],y:[0],z:[0],...R};const j=[{result:e.HS.executeBasedOnType(R,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let q={};q.item=y,e.HS.updateListInputs(q),q={...q};const V=[{result:q.item}];let G={};G.first=S,e.HS.updateListInputs(G),G={first:[1],second:[-2],operation:[\\"divide\\"],...G};const J=[{result:e.HS.executeBasedOnType(G,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let K={};K.first=S,e.HS.updateListInputs(K),K={first:[1],second:[-4],operation:[\\"divide\\"],...K};const Q=[{result:e.HS.executeBasedOnType(K,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let U={};U.first=y,U.second=O,e.HS.updateListInputs(U),U={first:[1],second:[.4],operation:[\\"add\\"],...U};const $=[{result:e.HS.executeBasedOnType(U,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let _={};_.item=S,e.HS.updateListInputs(_),_={..._};const ee=[{result:_.item}],te={faceOpacity:[1],edgeOpacity:[1],edgeColour:[\\"#1c1c1c\\"],faceColour:[\\"#bdbdbd\\"],vertexColour:[\\"#ff00ff\\"],faceMaterial:[void 0],edgeWidth:[2],vertexSize:[.03],drawEdges:[!0],drawFaces:[!0],drawVertices:[!1],precision:[.01],drawEdgeIndexes:[!1],edgeIndexHeight:[.06],edgeIndexColour:[\\"ff00ff\\"],drawFaceIndexes:[!1],faceIndexHeight:[.06],faceIndexColour:[\\"#0000ff\\"]};let se={};se.faceMaterial=C,e.HS.updateListInputs(se),se={...te,...se};const ne=[{result:e.HS.executeBasedOnType(se,!1,(e=>t.draw.optionsOcctShape(e))),transformers:[]}];let re={};re.center=Z,re.direction=X,e.HS.updateListInputs(re),re={radius:[3],height:[1.9],center:[[0,0,0]],direction:[[0,1,0]],...re};const ae=[{result:await e.HS.executeBasedOnTypeAsync(re,!1,(e=>t.occt.shapes.solid.createCylinder(e))),transformers:[]}];let oe={};oe.y=$,e.HS.updateListInputs(oe),oe={x:[0],y:[12],z:[0],...oe};const ie=[{result:e.HS.executeBasedOnType(oe,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let ce={};ce.first=D,e.HS.updateListInputs(ce),ce={first:[1],second:[3],operation:[\\"multiply\\"],...ce};const pe=[{result:e.HS.executeBasedOnType(ce,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let ue={};ue.first=V,ue.second=O,e.HS.updateListInputs(ue),ue={first:[1],second:[.4],operation:[\\"add\\"],...ue};const le=[{result:e.HS.executeBasedOnType(ue,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let de={};de.first=V,de.second=O,e.HS.updateListInputs(de),de={first:[1],second:[.4],operation:[\\"subtract\\"],...de};const me=[{result:e.HS.executeBasedOnType(de,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let ye={};ye.first=ee,e.HS.updateListInputs(ye),ye={first:[1],second:[-.2],operation:[\\"multiply\\"],...ye};const Se=[{result:e.HS.executeBasedOnType(ye,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let He={};He.second=D,e.HS.updateListInputs(He),He={first:[360],second:[1],operation:[\\"divide\\"],...He};const fe=[{result:e.HS.executeBasedOnType(He,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}],he={shape:[void 0],radius:[.3],radiusList:[void 0],indexes:[void 0]};let xe={};xe.shape=ae,e.HS.updateListInputs(xe),xe={...he,...xe};const ve=[{result:await e.HS.executeBasedOnTypeAsync(xe,!1,(e=>t.occt.fillets.filletEdges(e))),transformers:[]}];let Oe={};Oe.start=L,Oe.end=ie,e.HS.updateListInputs(Oe),Oe={start:[[0,0,0]],end:[[0,1,0]],...Oe};const Ie=[{result:await e.HS.executeBasedOnTypeAsync(Oe,!1,(e=>t.occt.shapes.wire.createLineWire(e))),transformers:[]}];let Le={};Le.second=pe,e.HS.updateListInputs(Le),Le={first:[360],second:[1],operation:[\\"divide\\"],...Le};const Be=[{result:e.HS.executeBasedOnType(Le,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let we={};we.start=w,we.end=ie,e.HS.updateListInputs(we),we={start:[[0,0,0]],end:[[0,1,0]],...we};const Te=[{result:await e.HS.executeBasedOnTypeAsync(we,!1,(e=>t.occt.shapes.wire.createLineWire(e))),transformers:[]}];let ge={};ge.y=le,e.HS.updateListInputs(ge),ge={x:[0],y:[0],z:[.05],...ge};const Ae=[{result:e.HS.executeBasedOnType(ge,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Ee={};Ee.y=me,Ee.z=Q,e.HS.updateListInputs(Ee),Ee={x:[0],y:[0],z:[-1],...Ee};const be=[{result:e.HS.executeBasedOnType(Ee,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let ze={};ze.y=me,ze.z=J,e.HS.updateListInputs(ze),ze={x:[0],y:[0],z:[0],...ze};const We=[{result:e.HS.executeBasedOnType(ze,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Ce={};Ce.z=Se,e.HS.updateListInputs(Ce),Ce={x:[0],y:[0],z:[0],...Ce};const Pe=[{result:e.HS.executeBasedOnType(Ce,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Xe={};Xe.step=fe,e.HS.updateListInputs(Xe),Xe={step:[.1],min:[0],max:[360],...Xe};const Ye=e.HS.executeBasedOnType(Xe,!1,(e=>t.vector.span(e))),Ze=[];for(let e=0;e<1;e++)Ze.push({type:\\"flat\\"});const Ne=[{result:Ye,transformers:Ze}];let ke={};ke.first=Se,e.HS.updateListInputs(ke),ke={first:[2],second:[-2],operation:[\\"multiply\\"],...ke};e.HS.executeBasedOnType(ke,!1,(e=>t.math.twoNrOperation(e)));let Me={};Me.listElements=ve,e.HS.updateListInputs(Me),Me={...Me};const Fe=[{result:[Me.listElements?Me.listElements:[]]}],De={shape:[void 0],axis:[[0,0,1]],angle:[0]};let Re={};Re.shape=Ie,Re.axis=o,Re.angle=Be,e.HS.updateListInputs(Re),Re={...De,...Re};const je=[{result:await e.HS.executeBasedOnTypeAsync(Re,!1,(e=>t.occt.transforms.rotate(e))),transformers:[]}];let qe={};qe.first=Be,e.HS.updateListInputs(qe),qe={first:[1],second:[.4],operation:[\\"multiply\\"],...qe};const Ve=[{result:e.HS.executeBasedOnType(qe,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let Ge={};Ge.first=Be,e.HS.updateListInputs(Ge),Ge={first:[1],second:[.6],operation:[\\"multiply\\"],...Ge};const Je=[{result:e.HS.executeBasedOnType(Ge,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let Ke={};Ke.listElements=[Ae[0],j[0],be[0],We[0]],e.HS.updateListInputs(Ke),Ke={...Ke};const Qe=[{result:[Ke.listElements?Ke.listElements:[]]}];let Ue={};Ue.item=Ne,e.HS.updateListInputs(Ue),Ue={...Ue};const $e=[{result:Ue.item}],_e={shape:[void 0],nrOfDivisions:[11],removeStartPoint:[!1],removeEndPoint:[!1]};let et={};et.shape=je,et.nrOfDivisions=l,e.HS.updateListInputs(et),et={..._e,...et};const tt=[{result:await e.HS.executeBasedOnTypeAsync(et,!1,(e=>t.occt.shapes.wire.divideWireByEqualDistanceToPoints(e))),transformers:[]}],st={shape:[void 0],axis:[[0,0,1]],angle:[0]};let nt={};nt.shape=Te,nt.axis=o,nt.angle=[Ve[0],Je[0]],e.HS.updateListInputs(nt),nt={...st,...nt};const rt=[{result:await e.HS.executeBasedOnTypeAsync(nt,!1,(e=>t.occt.transforms.rotate(e))),transformers:[]}];let at={};at.number=Ve,e.HS.updateListInputs(at),at={number:[1],operation:[\\"negate\\"],...at};const ot=[{result:e.HS.executeBasedOnType(at,!1,(e=>t.math.oneNrOperation(e))),transformers:[]}],it={points:[void 0]};let ct={};ct.points=Qe,e.HS.updateListInputs(ct),ct={...it,...ct};const pt=[{result:await e.HS.executeBasedOnTypeAsync(ct,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}];e.HS.drawNodeMeshes(pt,t);const ut={list:[void 0],pattern:[[!0,!0,!1]]};let lt={};lt.list=tt,lt.pattern=u,e.HS.updateListInputs(lt),lt={...ut,...lt};const dt=[{result:e.HS.executeBasedOnType(lt,!0,(e=>t.lists.getByPattern(e))),transformers:[]}];let mt={};mt.listElements=rt,e.HS.updateListInputs(mt),mt={...mt};const yt=[{result:[mt.listElements?mt.listElements:[]]}],St={shape:[void 0],origin:[[0,0,0]],direction:[[0,0,1]]};let Ht={};Ht.shape=pt,Ht.origin=We,Ht.direction=f,e.HS.updateListInputs(Ht),Ht={...St,...Ht};const ft=[{result:await e.HS.executeBasedOnTypeAsync(Ht,!1,(e=>t.occt.transforms.mirror(e))),transformers:[]}],ht={shape:[void 0]};let xt={};xt.shape=pt,e.HS.updateListInputs(xt),xt={...ht,...xt};const vt=await e.HS.executeBasedOnTypeAsync(xt,!1,(e=>t.occt.shapes.edge.getCornerPointsOfEdgesForShape(e))),Ot=[];for(let e=0;e<1;e++)Ot.push({type:\\"flat\\"});const It=[{result:vt,transformers:Ot}],Lt={list:[void 0],index:[0],clone:[!0]};let Bt={};Bt.list=yt,e.HS.updateListInputs(Bt),Bt={...Lt,...Bt};const wt=[{result:e.HS.executeBasedOnType(Bt,!1,(e=>t.lists.getItem(e))),transformers:[]}],Tt={shape:[void 0]};let gt={};gt.shape=ft,e.HS.updateListInputs(gt),gt={...Tt,...gt};const At=[{result:await e.HS.executeBasedOnTypeAsync(gt,!1,(e=>t.occt.shapes.edge.getCornerPointsOfEdgesForShape(e))),transformers:[]}],Et={shape:[void 0],nrOfDivisions:[11],removeStartPoint:[!1],removeEndPoint:[!1]};let bt={};bt.shape=wt,bt.nrOfDivisions=l,e.HS.updateListInputs(bt),bt={...Et,...bt};const zt=[{result:await e.HS.executeBasedOnTypeAsync(bt,!1,(e=>t.occt.shapes.wire.divideWireByEqualDistanceToPoints(e))),transformers:[]}],Wt={list:[void 0],index:[3],clone:[!0]};let Ct={};Ct.list=At,e.HS.updateListInputs(Ct),Ct={...Wt,...Ct};const Pt=[{result:e.HS.executeBasedOnType(Ct,!1,(e=>t.lists.removeItemAtIndex(e))),transformers:[]}],Xt={list:[void 0],pattern:[[!0,!0,!1]]};let Yt={};Yt.list=zt,Yt.pattern=c,e.HS.updateListInputs(Yt),Yt={...Xt,...Yt};const Zt=[{result:e.HS.executeBasedOnType(Yt,!1,(e=>t.lists.getByPattern(e))),transformers:[]}],Nt={list:[void 0],clone:[!0]};let kt={};kt.list=Pt,e.HS.updateListInputs(kt),kt={...Nt,...kt};const Mt=e.HS.executeBasedOnType(kt,!1,(e=>t.lists.reverse(e))),Ft=[];for(let e=0;e<1;e++)Ft.push({type:\\"flat\\"});const Dt=[{result:Mt,transformers:Ft}];let Rt={};Rt.listElements=[Zt[0],dt[0]],e.HS.updateListInputs(Rt),Rt={...Rt};const jt=[{result:[Rt.listElements?Rt.listElements:[]]}];let qt={};qt.listElements=[It[0],Dt[0]],e.HS.updateListInputs(qt),qt={...qt};const Vt=[{result:[qt.listElements?qt.listElements:[]]}],Gt={list:[void 0],clone:[!0]};let Jt={};Jt.list=jt,e.HS.updateListInputs(Jt),Jt={...Gt,...Jt};const Kt=e.HS.executeBasedOnType(Jt,!1,(e=>t.lists.flipLists(e))),Qt=[];for(let e=0;e<2;e++)Qt.push({type:\\"flat\\"});const Ut=[{result:Kt,transformers:Qt}],$t={points:[void 0]};let _t={};_t.points=Vt,e.HS.updateListInputs(_t),_t={...$t,..._t};const es=[{result:await e.HS.executeBasedOnTypeAsync(_t,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}];let ts={};ts.listElements=Ut,e.HS.updateListInputs(ts),ts={...ts};const ss=[{result:[ts.listElements?ts.listElements:[]]}],ns={shape:[void 0],radius:[.3],radiusList:[void 0],indexes:[void 0]};let rs={};rs.shape=es,e.HS.updateListInputs(rs),rs={...ns,...rs};const as=[{result:await e.HS.executeBasedOnTypeAsync(rs,!1,(e=>t.occt.fillets.fillet2d(e))),transformers:[]}],os={points:[void 0]};let is={};is.points=ss,e.HS.updateListInputs(is),is={...os,...is};const cs=[{result:await e.HS.executeBasedOnTypeAsync(is,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}],ps={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let us={};us.shape=as,us.direction=x,e.HS.updateListInputs(us),us={...ps,...us};const ls=[{result:await e.HS.executeBasedOnTypeAsync(us,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}],ds={shape:[void 0]};let ms={};ms.shape=as,e.HS.updateListInputs(ms),ms={...ds,...ms};const ys=[{result:await e.HS.executeBasedOnTypeAsync(ms,!1,(e=>t.occt.shapes.wire.startPointOnWire(e))),transformers:[]}],Ss={shape:[void 0]};let Hs={};Hs.shape=as,e.HS.updateListInputs(Hs),Hs={...Ss,...Hs};const fs=[{result:await e.HS.executeBasedOnTypeAsync(Hs,!1,(e=>t.occt.shapes.wire.endPointOnWire(e))),transformers:[]}],hs={shape:[void 0]};let xs={};xs.shape=as,e.HS.updateListInputs(xs),xs={...hs,...xs};const vs=[{result:await e.HS.executeBasedOnTypeAsync(xs,!1,(e=>t.occt.shapes.wire.closeOpenWire(e))),transformers:[]}],Os={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let Is={};Is.shape=vs,Is.direction=x,e.HS.updateListInputs(Is),Is={...Os,...Is};const Ls=[{result:await e.HS.executeBasedOnTypeAsync(Is,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}],Bs={shape:[void 0],radius:[1],radiusList:[void 0],indexes:[void 0],direction:[[0,1,0]]};let ws={};ws.shape=cs,ws.direction=g,e.HS.updateListInputs(ws),ws={...Bs,...ws};const Ts=[{result:await e.HS.executeBasedOnTypeAsync(ws,!1,(e=>t.occt.fillets.fillet3DWire(e))),transformers:[]}],gs={shape:[void 0],face:[void 0],distance:[-.2],tolerance:[.1]};let As={};As.shape=ls,e.HS.updateListInputs(As),As={...gs,...As};const Es=[{result:await e.HS.executeBasedOnTypeAsync(As,!1,(e=>t.occt.operations.offset(e))),transformers:[]}],bs={shape:[void 0],index:[0]};let zs={};zs.shape=ls,e.HS.updateListInputs(zs),zs={...bs,...zs};const Ws=[{result:await e.HS.executeBasedOnTypeAsync(zs,!1,(e=>t.occt.shapes.wire.getWire(e))),transformers:[]}];let Cs={};Cs.item=ys,e.HS.updateListInputs(Cs),Cs={...Cs};const Ps=[{result:Cs.item}];let Xs={};Xs.item=fs,e.HS.updateListInputs(Xs),Xs={...Xs};const Ys=[{result:Xs.item}];let Zs={};Zs.start=fs,Zs.end=ys,e.HS.updateListInputs(Zs),Zs={start:[[0,0,0]],end:[[0,1,0]],...Zs};const Ns=[{result:await e.HS.executeBasedOnTypeAsync(Zs,!1,(e=>t.occt.shapes.wire.createLineWire(e))),transformers:[]}];e.HS.drawNodeMeshes(Ns,t);const ks={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let Ms={};Ms.shape=Ts,Ms.angle=ot,Ms.direction=o,e.HS.updateListInputs(Ms),Ms={...ks,...Ms};const Fs=[{result:await e.HS.executeBasedOnTypeAsync(Ms,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}],Ds={shape:[void 0]};let Rs={};Rs.shape=Ls,e.HS.updateListInputs(Rs),Rs={...Ds,...Rs};const js=[{result:await e.HS.executeBasedOnTypeAsync(Rs,!1,(e=>t.occt.shapes.solid.fromClosedShell(e))),transformers:[]}],qs={shape:[void 0],index:[1]};let Vs={};Vs.shape=Ws,e.HS.updateListInputs(Vs),Vs={...qs,...Vs};const Gs=[{result:await e.HS.executeBasedOnTypeAsync(Vs,!1,(e=>t.occt.shapes.edge.getEdge(e))),transformers:[]}],Js={shape:[void 0],index:[0]};let Ks={};Ks.shape=Es,e.HS.updateListInputs(Ks),Ks={...Js,...Ks};const Qs=[{result:await e.HS.executeBasedOnTypeAsync(Ks,!1,(e=>t.occt.shapes.wire.getWire(e))),transformers:[]}],Us={shape:[void 0],translation:[[0,0,0]]};let $s={};$s.shape=Ns,$s.translation=E,e.HS.updateListInputs($s),$s={...Us,...$s};const _s=[{result:await e.HS.executeBasedOnTypeAsync($s,!1,(e=>t.occt.transforms.translate(e))),transformers:[]}],en={shape:[void 0],direction:[[0,1,0]]};let tn={};tn.shape=Fs,tn.direction=Pe,e.HS.updateListInputs(tn),tn={...en,...tn};const sn=[{result:await e.HS.executeBasedOnTypeAsync(tn,!1,(e=>t.occt.operations.extrude(e))),transformers:[]}];let nn={};nn.listElements=js,e.HS.updateListInputs(nn),nn={...nn};const rn=[{result:[nn.listElements?nn.listElements:[]]}],an={shape:[void 0],index:[1]};let on={};on.shape=Qs,e.HS.updateListInputs(on),on={...an,...on};const cn=[{result:await e.HS.executeBasedOnTypeAsync(on,!1,(e=>t.occt.shapes.edge.getEdge(e))),transformers:[]}];let pn={};pn.listElements=Gs,e.HS.updateListInputs(pn),pn={...pn};const un=[{result:[pn.listElements?pn.listElements:[]]}],ln={shape:[void 0]};let dn={};dn.shape=_s,e.HS.updateListInputs(dn),dn={...ln,...dn};const mn=[{result:await e.HS.executeBasedOnTypeAsync(dn,!1,(e=>t.occt.shapes.wire.startPointOnWire(e))),transformers:[]}],yn={shape:[void 0]};let Sn={};Sn.shape=_s,e.HS.updateListInputs(Sn),Sn={...yn,...Sn};const Hn=[{result:await e.HS.executeBasedOnTypeAsync(Sn,!1,(e=>t.occt.shapes.wire.endPointOnWire(e))),transformers:[]}],fn={shapes:[void 0]};let hn={};hn.shapes=un,e.HS.updateListInputs(hn),hn={...fn,...hn};const xn=[{result:await e.HS.executeBasedOnTypeAsync(hn,!1,(e=>t.occt.shapes.wire.combineEdgesAndWiresIntoAWire(e))),transformers:[]}];let vn={};vn.listElements=cn,e.HS.updateListInputs(vn),vn={...vn};const On=[{result:[vn.listElements?vn.listElements:[]]}],In={shape:[void 0],shapes:[void 0],keepEdges:[!1]};let Ln={};Ln.shape=sn,Ln.shapes=Fe,e.HS.updateListInputs(Ln),Ln={...In,...Ln};const Bn=[{result:await e.HS.executeBasedOnTypeAsync(Ln,!1,(e=>t.occt.booleans.difference(e))),transformers:[]}];let wn={};wn.item=Hn,e.HS.updateListInputs(wn),wn={...wn};const Tn=[{result:wn.item}];let gn={};gn.item=mn,e.HS.updateListInputs(gn),gn={...gn};const An=[{result:gn.item}],En={shape:[void 0],shapes:[void 0],keepEdges:[!1]};let bn={};bn.shape=Bn,bn.shapes=rn,e.HS.updateListInputs(bn),bn={...En,...bn};const zn=[{result:await e.HS.executeBasedOnTypeAsync(bn,!1,(e=>t.occt.booleans.difference(e))),transformers:[]}],Wn={shapes:[void 0]};let Cn={};Cn.shapes=On,e.HS.updateListInputs(Cn),Cn={...Wn,...Cn};const Pn=[{result:await e.HS.executeBasedOnTypeAsync(Cn,!1,(e=>t.occt.shapes.wire.combineEdgesAndWiresIntoAWire(e))),transformers:[]}];let Xn={};Xn.listElements=[Ps[0],Tn[0],An[0],Ys[0]],e.HS.updateListInputs(Xn),Xn={...Xn};const Yn=[{result:[Xn.listElements?Xn.listElements:[]]}],Zn={shape:[void 0],origin:[[0,0,0]],normal:[[0,0,1]]};let Nn={};Nn.shape=zn,Nn.normal=m,e.HS.updateListInputs(Nn),Nn={...Zn,...Nn};const kn=[{result:await e.HS.executeBasedOnTypeAsync(Nn,!1,(e=>t.occt.transforms.mirrorAlongNormal(e))),transformers:[]}];let Mn={};Mn.listElements=[xn[0],Pn[0]],e.HS.updateListInputs(Mn),Mn={...Mn};const Fn=[{result:[Mn.listElements?Mn.listElements:[]]}],Dn={points:[void 0]};let Rn={};Rn.points=Yn,e.HS.updateListInputs(Rn),Rn={...Dn,...Rn};const jn=[{result:await e.HS.executeBasedOnTypeAsync(Rn,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}];let qn={};qn.listElements=[kn[0],zn[0]],e.HS.updateListInputs(qn),qn={...qn};const Vn=[{result:[qn.listElements?qn.listElements:[]]}],Gn={shapes:[void 0],makeSolid:[!1]};let Jn={};Jn.shapes=Fn,e.HS.updateListInputs(Jn),Jn={...Gn,...Jn};const Kn=[{result:await e.HS.executeBasedOnTypeAsync(Jn,!1,(e=>t.occt.operations.loft(e))),transformers:[]}],Qn={shape:[void 0],radius:[.5],radiusList:[void 0],indexes:[void 0]};let Un={};Un.shape=jn,e.HS.updateListInputs(Un),Un={...Qn,...Un};const $n=[{result:await e.HS.executeBasedOnTypeAsync(Un,!1,(e=>t.occt.fillets.fillet2d(e))),transformers:[]}],_n={shapes:[void 0]};let er={};er.shapes=Vn,e.HS.updateListInputs(er),er={..._n,...er};const tr=[{result:await e.HS.executeBasedOnTypeAsync(er,!1,(e=>t.occt.shapes.compound.makeCompound(e))),transformers:[]}],sr={shape:[void 0],origin:[[0,0,0]],direction:[[0,0,1]]};let nr={};nr.shape=Kn,nr.origin=We,nr.direction=f,e.HS.updateListInputs(nr),nr={...sr,...nr};const rr=[{result:await e.HS.executeBasedOnTypeAsync(nr,!1,(e=>t.occt.transforms.mirror(e))),transformers:[]}],ar={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let or={};or.shape=$n,or.direction=x,e.HS.updateListInputs(or),or={...ar,...or};const ir=[{result:await e.HS.executeBasedOnTypeAsync(or,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}];let cr={};cr.listElements=[ls[0],Es[0],Kn[0],rr[0]],e.HS.updateListInputs(cr),cr={...cr};const pr=[{result:[cr.listElements?cr.listElements:[]]}],ur={shape:[void 0],offset:[-.1]};let lr={};lr.shape=ir,e.HS.updateListInputs(lr),lr={...ur,...lr};const dr=[{result:await e.HS.executeBasedOnTypeAsync(lr,!1,(e=>t.occt.operations.makeThickSolidSimple(e))),transformers:[]}],mr={shape:[void 0],angle:[0],center:[[0,0,0]],axis:[[0,0,1]]};let yr={};yr.shape=tr,yr.angle=$e,yr.axis=k,e.HS.updateListInputs(yr),yr={...mr,...yr};const Sr=[{result:await e.HS.executeBasedOnTypeAsync(yr,!1,(e=>t.occt.transforms.rotateAroundCenter(e))),transformers:[]}],Hr={shapes:[void 0],tolerance:[1e-7]};let fr={};fr.shapes=pr,e.HS.updateListInputs(fr),fr={...Hr,...fr};const hr=[{result:await e.HS.executeBasedOnTypeAsync(fr,!1,(e=>t.occt.shapes.shell.sewFaces(e))),transformers:[]}],xr={entity:[void 0],options:[void 0],babylonMesh:[void 0]};let vr={};vr.entity=dr,vr.options=z,e.HS.updateListInputs(vr),vr={...xr,...vr};await e.HS.executeBasedOnTypeAsync(vr,!1,(e=>t.draw.drawAnyAsync(e)));let Or={};Or.listElements=Sr,e.HS.updateListInputs(Or),Or={...Or};const Ir=[{result:[Or.listElements?Or.listElements:[]]}],Lr={shapes:[void 0]};let Br={};Br.shapes=Ir,e.HS.updateListInputs(Br),Br={...Lr,...Br};const wr=[{result:await e.HS.executeBasedOnTypeAsync(Br,!1,(e=>t.occt.shapes.compound.makeCompound(e))),transformers:[]}];let Tr={};Tr.listElements=[hr[0],ve[0],wr[0]],e.HS.updateListInputs(Tr),Tr={...Tr};const gr=[{result:[Tr.listElements?Tr.listElements:[]]}],Ar={shapes:[void 0]};let Er={};Er.shapes=gr,e.HS.updateListInputs(Er),Er={...Ar,...Er};const br=[{result:await e.HS.executeBasedOnTypeAsync(Er,!1,(e=>t.occt.shapes.compound.makeCompound(e))),transformers:[]}],zr={entity:[void 0],options:[void 0],babylonMesh:[void 0]};let Wr={};Wr.entity=br,Wr.options=ne,e.HS.updateListInputs(Wr),Wr={...zr,...Wr};await e.HS.executeBasedOnTypeAsync(Wr,!1,(e=>t.draw.drawAnyAsync(e)))}(BitByBit,bitbybit,bitbybitRunnerResult,bitbybitRunnerInputs,Bit);\"}' + return '{\"type\":\"rete\",\"version\":\"0.21.0\",\"script\":\"!async function(e,t,s,n,r){let a={};a={x:[0],y:[0],z:[1],...a};const o=[{result:e.HS.executeBasedOnType(a,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let i={};i={text:[\\"[true,false]\\"],...i};const c=[{result:e.HS.executeBasedOnType(i,!1,(e=>t.json.parse(e))),transformers:[]}];let p={};p={text:[\\"[false,true]\\"],...p};const u=[{result:e.HS.executeBasedOnType(p,!1,(e=>t.json.parse(e))),transformers:[]}],l=[{result:[5],transformers:[]}];let d={};d={x:[1],y:[0],z:[0],...d};const m=[{result:e.HS.executeBasedOnType(d,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}],y=[{result:[12],transformers:[]}],S=[{result:[7],transformers:[]}];let H={};H={x:[0],y:[1],z:[0],...H};const f=[{result:e.HS.executeBasedOnType(H,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let h={};h={x:[0],y:[0],z:[1],...h};const x=[{result:e.HS.executeBasedOnType(h,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let v={};v={number:[.4],...v};const O=[{result:e.HS.executeBasedOnType(v,!1,(e=>t.math.number(e))),transformers:[]}];let I={};I={x:[0],y:[0],z:[-1],...I};const L=[{result:e.HS.executeBasedOnType(I,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let B={};B={x:[0],y:[0],z:[-2],...B};const w=[{result:e.HS.executeBasedOnType(B,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let T={};T={x:[0],y:[0],z:[1],...T};const g=[{result:e.HS.executeBasedOnType(T,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let A={};A={x:[0],y:[1.5],z:[0],...A};const E=[{result:e.HS.executeBasedOnType(A,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let b={};b={...{faceOpacity:[.5],edgeOpacity:[.5],edgeColour:[\\"#000000\\"],faceColour:[\\"#212121\\"],vertexColour:[\\"#ff00ff\\"],faceMaterial:[void 0],edgeWidth:[2],vertexSize:[.03],drawEdges:[!0],drawFaces:[!0],drawVertices:[!1],precision:[.02],drawEdgeIndexes:[!1],edgeIndexHeight:[.06],edgeIndexColour:[\\"ff00ff\\"],drawFaceIndexes:[!1],faceIndexHeight:[.06],faceIndexColour:[\\"#0000ff\\"]},...b};const z=[{result:e.HS.executeBasedOnType(b,!1,(e=>t.draw.optionsOcctShape(e))),transformers:[]}];let W={};W={name:[\\"Custom Material\\"],baseColor:[\\"#9c9cba\\"],emissiveColor:[\\"#000000\\"],metallic:[.9],roughness:[.1],alpha:[1],backFaceCulling:[!1],zOffset:[2],...W};const C=[{result:e.HS.executeBasedOnType(W,!1,(e=>t.babylon.material.pbrMetallicRoughness.create(e))),transformers:[]}];let P={};P={x:[0],y:[0],z:[-1],...P};const X=[{result:e.HS.executeBasedOnType(P,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Y={};Y={x:[0],y:[0],z:[-1.5],...Y};const Z=[{result:e.HS.executeBasedOnType(Y,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let N={};N={x:[0],y:[0],z:[1],...N};const k=[{result:e.HS.executeBasedOnType(N,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let M={};M={skybox:[\\"city\\"],size:[1e3],blur:[.4],environmentIntensity:[.4],...M};e.HS.executeBasedOnType(M,!1,(e=>t.babylon.scene.enableSkybox(e)));let F={number:[{result:[20],transformers:[]}]};e.HS.updateListInputs(F),F={number:[20],...F};const D=[{result:e.HS.executeBasedOnType(F,!1,(e=>t.math.number(e))),transformers:[]}];let R={};R.y=y,e.HS.updateListInputs(R),R={x:[0],y:[0],z:[0],...R};const j=[{result:e.HS.executeBasedOnType(R,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let q={};q.item=y,e.HS.updateListInputs(q),q={...q};const V=[{result:q.item}];let G={};G.first=S,e.HS.updateListInputs(G),G={first:[1],second:[-2],operation:[\\"divide\\"],...G};const J=[{result:e.HS.executeBasedOnType(G,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let K={};K.first=S,e.HS.updateListInputs(K),K={first:[1],second:[-4],operation:[\\"divide\\"],...K};const Q=[{result:e.HS.executeBasedOnType(K,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let U={};U.first=y,U.second=O,e.HS.updateListInputs(U),U={first:[1],second:[.4],operation:[\\"add\\"],...U};const $=[{result:e.HS.executeBasedOnType(U,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let _={};_.item=S,e.HS.updateListInputs(_),_={..._};const ee=[{result:_.item}],te={faceOpacity:[1],edgeOpacity:[1],edgeColour:[\\"#1c1c1c\\"],faceColour:[\\"#bdbdbd\\"],vertexColour:[\\"#ff00ff\\"],faceMaterial:[void 0],edgeWidth:[2],vertexSize:[.03],drawEdges:[!0],drawFaces:[!0],drawVertices:[!1],precision:[.01],drawEdgeIndexes:[!1],edgeIndexHeight:[.06],edgeIndexColour:[\\"ff00ff\\"],drawFaceIndexes:[!1],faceIndexHeight:[.06],faceIndexColour:[\\"#0000ff\\"]};let se={};se.faceMaterial=C,e.HS.updateListInputs(se),se={...te,...se};const ne=[{result:e.HS.executeBasedOnType(se,!1,(e=>t.draw.optionsOcctShape(e))),transformers:[]}];let re={};re.center=Z,re.direction=X,e.HS.updateListInputs(re),re={radius:[3],height:[1.9],center:[[0,0,0]],direction:[[0,1,0]],...re};const ae=[{result:await e.HS.executeBasedOnTypeAsync(re,!1,(e=>t.occt.shapes.solid.createCylinder(e))),transformers:[]}];let oe={};oe.y=$,e.HS.updateListInputs(oe),oe={x:[0],y:[12],z:[0],...oe};const ie=[{result:e.HS.executeBasedOnType(oe,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let ce={};ce.first=D,e.HS.updateListInputs(ce),ce={first:[1],second:[3],operation:[\\"multiply\\"],...ce};const pe=[{result:e.HS.executeBasedOnType(ce,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let ue={};ue.first=V,ue.second=O,e.HS.updateListInputs(ue),ue={first:[1],second:[.4],operation:[\\"add\\"],...ue};const le=[{result:e.HS.executeBasedOnType(ue,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let de={};de.first=V,de.second=O,e.HS.updateListInputs(de),de={first:[1],second:[.4],operation:[\\"subtract\\"],...de};const me=[{result:e.HS.executeBasedOnType(de,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let ye={};ye.first=ee,e.HS.updateListInputs(ye),ye={first:[1],second:[-.2],operation:[\\"multiply\\"],...ye};const Se=[{result:e.HS.executeBasedOnType(ye,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let He={};He.second=D,e.HS.updateListInputs(He),He={first:[360],second:[1],operation:[\\"divide\\"],...He};const fe=[{result:e.HS.executeBasedOnType(He,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}],he={shape:[void 0],radius:[.3],radiusList:[void 0],indexes:[void 0]};let xe={};xe.shape=ae,e.HS.updateListInputs(xe),xe={...he,...xe};const ve=[{result:await e.HS.executeBasedOnTypeAsync(xe,!1,(e=>t.occt.fillets.filletEdges(e))),transformers:[]}];let Oe={};Oe.start=L,Oe.end=ie,e.HS.updateListInputs(Oe),Oe={start:[[0,0,0]],end:[[0,1,0]],...Oe};const Ie=[{result:await e.HS.executeBasedOnTypeAsync(Oe,!1,(e=>t.occt.shapes.wire.createLineWire(e))),transformers:[]}];let Le={};Le.second=pe,e.HS.updateListInputs(Le),Le={first:[360],second:[1],operation:[\\"divide\\"],...Le};const Be=[{result:e.HS.executeBasedOnType(Le,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let we={};we.start=w,we.end=ie,e.HS.updateListInputs(we),we={start:[[0,0,0]],end:[[0,1,0]],...we};const Te=[{result:await e.HS.executeBasedOnTypeAsync(we,!1,(e=>t.occt.shapes.wire.createLineWire(e))),transformers:[]}];let ge={};ge.y=le,e.HS.updateListInputs(ge),ge={x:[0],y:[0],z:[.05],...ge};const Ae=[{result:e.HS.executeBasedOnType(ge,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Ee={};Ee.y=me,Ee.z=Q,e.HS.updateListInputs(Ee),Ee={x:[0],y:[0],z:[-1],...Ee};const be=[{result:e.HS.executeBasedOnType(Ee,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let ze={};ze.y=me,ze.z=J,e.HS.updateListInputs(ze),ze={x:[0],y:[0],z:[0],...ze};const We=[{result:e.HS.executeBasedOnType(ze,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Ce={};Ce.z=Se,e.HS.updateListInputs(Ce),Ce={x:[0],y:[0],z:[0],...Ce};const Pe=[{result:e.HS.executeBasedOnType(Ce,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Xe={};Xe.step=fe,e.HS.updateListInputs(Xe),Xe={step:[.1],min:[0],max:[360],...Xe};const Ye=e.HS.executeBasedOnType(Xe,!1,(e=>t.vector.span(e))),Ze=[];for(let e=0;e<1;e++)Ze.push({type:\\"flat\\"});const Ne=[{result:Ye,transformers:Ze}];let ke={};ke.first=Se,e.HS.updateListInputs(ke),ke={first:[2],second:[-2],operation:[\\"multiply\\"],...ke};e.HS.executeBasedOnType(ke,!1,(e=>t.math.twoNrOperation(e)));let Me={};Me.listElements=ve,e.HS.updateListInputs(Me),Me={...Me};const Fe=[{result:[Me.listElements?Me.listElements:[]]}],De={shape:[void 0],axis:[[0,0,1]],angle:[0]};let Re={};Re.shape=Ie,Re.axis=o,Re.angle=Be,e.HS.updateListInputs(Re),Re={...De,...Re};const je=[{result:await e.HS.executeBasedOnTypeAsync(Re,!1,(e=>t.occt.transforms.rotate(e))),transformers:[]}];let qe={};qe.first=Be,e.HS.updateListInputs(qe),qe={first:[1],second:[.4],operation:[\\"multiply\\"],...qe};const Ve=[{result:e.HS.executeBasedOnType(qe,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let Ge={};Ge.first=Be,e.HS.updateListInputs(Ge),Ge={first:[1],second:[.6],operation:[\\"multiply\\"],...Ge};const Je=[{result:e.HS.executeBasedOnType(Ge,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let Ke={};Ke.listElements=[Ae[0],j[0],be[0],We[0]],e.HS.updateListInputs(Ke),Ke={...Ke};const Qe=[{result:[Ke.listElements?Ke.listElements:[]]}];let Ue={};Ue.item=Ne,e.HS.updateListInputs(Ue),Ue={...Ue};const $e=[{result:Ue.item}],_e={shape:[void 0],nrOfDivisions:[11],removeStartPoint:[!1],removeEndPoint:[!1]};let et={};et.shape=je,et.nrOfDivisions=l,e.HS.updateListInputs(et),et={..._e,...et};const tt=[{result:await e.HS.executeBasedOnTypeAsync(et,!1,(e=>t.occt.shapes.wire.divideWireByEqualDistanceToPoints(e))),transformers:[]}],st={shape:[void 0],axis:[[0,0,1]],angle:[0]};let nt={};nt.shape=Te,nt.axis=o,nt.angle=[Ve[0],Je[0]],e.HS.updateListInputs(nt),nt={...st,...nt};const rt=[{result:await e.HS.executeBasedOnTypeAsync(nt,!1,(e=>t.occt.transforms.rotate(e))),transformers:[]}];let at={};at.number=Ve,e.HS.updateListInputs(at),at={number:[1],operation:[\\"negate\\"],...at};const ot=[{result:e.HS.executeBasedOnType(at,!1,(e=>t.math.oneNrOperation(e))),transformers:[]}],it={points:[void 0]};let ct={};ct.points=Qe,e.HS.updateListInputs(ct),ct={...it,...ct};const pt=[{result:await e.HS.executeBasedOnTypeAsync(ct,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}];e.HS.drawNodeMeshes(pt,t);const ut={list:[void 0],pattern:[[!0,!0,!1]]};let lt={};lt.list=tt,lt.pattern=u,e.HS.updateListInputs(lt),lt={...ut,...lt};const dt=[{result:e.HS.executeBasedOnType(lt,!0,(e=>t.lists.getByPattern(e))),transformers:[]}];let mt={};mt.listElements=rt,e.HS.updateListInputs(mt),mt={...mt};const yt=[{result:[mt.listElements?mt.listElements:[]]}],St={shape:[void 0],origin:[[0,0,0]],direction:[[0,0,1]]};let Ht={};Ht.shape=pt,Ht.origin=We,Ht.direction=f,e.HS.updateListInputs(Ht),Ht={...St,...Ht};const ft=[{result:await e.HS.executeBasedOnTypeAsync(Ht,!1,(e=>t.occt.transforms.mirror(e))),transformers:[]}],ht={shape:[void 0]};let xt={};xt.shape=pt,e.HS.updateListInputs(xt),xt={...ht,...xt};const vt=await e.HS.executeBasedOnTypeAsync(xt,!1,(e=>t.occt.shapes.edge.getCornerPointsOfEdgesForShape(e))),Ot=[];for(let e=0;e<1;e++)Ot.push({type:\\"flat\\"});const It=[{result:vt,transformers:Ot}],Lt={list:[void 0],index:[0],clone:[!0]};let Bt={};Bt.list=yt,e.HS.updateListInputs(Bt),Bt={...Lt,...Bt};const wt=[{result:e.HS.executeBasedOnType(Bt,!1,(e=>t.lists.getItem(e))),transformers:[]}],Tt={shape:[void 0]};let gt={};gt.shape=ft,e.HS.updateListInputs(gt),gt={...Tt,...gt};const At=[{result:await e.HS.executeBasedOnTypeAsync(gt,!1,(e=>t.occt.shapes.edge.getCornerPointsOfEdgesForShape(e))),transformers:[]}],Et={shape:[void 0],nrOfDivisions:[11],removeStartPoint:[!1],removeEndPoint:[!1]};let bt={};bt.shape=wt,bt.nrOfDivisions=l,e.HS.updateListInputs(bt),bt={...Et,...bt};const zt=[{result:await e.HS.executeBasedOnTypeAsync(bt,!1,(e=>t.occt.shapes.wire.divideWireByEqualDistanceToPoints(e))),transformers:[]}],Wt={list:[void 0],index:[3],clone:[!0]};let Ct={};Ct.list=At,e.HS.updateListInputs(Ct),Ct={...Wt,...Ct};const Pt=[{result:e.HS.executeBasedOnType(Ct,!1,(e=>t.lists.removeItemAtIndex(e))),transformers:[]}],Xt={list:[void 0],pattern:[[!0,!0,!1]]};let Yt={};Yt.list=zt,Yt.pattern=c,e.HS.updateListInputs(Yt),Yt={...Xt,...Yt};const Zt=[{result:e.HS.executeBasedOnType(Yt,!1,(e=>t.lists.getByPattern(e))),transformers:[]}],Nt={list:[void 0],clone:[!0]};let kt={};kt.list=Pt,e.HS.updateListInputs(kt),kt={...Nt,...kt};const Mt=e.HS.executeBasedOnType(kt,!1,(e=>t.lists.reverse(e))),Ft=[];for(let e=0;e<1;e++)Ft.push({type:\\"flat\\"});const Dt=[{result:Mt,transformers:Ft}];let Rt={};Rt.listElements=[Zt[0],dt[0]],e.HS.updateListInputs(Rt),Rt={...Rt};const jt=[{result:[Rt.listElements?Rt.listElements:[]]}];let qt={};qt.listElements=[It[0],Dt[0]],e.HS.updateListInputs(qt),qt={...qt};const Vt=[{result:[qt.listElements?qt.listElements:[]]}],Gt={list:[void 0],clone:[!0]};let Jt={};Jt.list=jt,e.HS.updateListInputs(Jt),Jt={...Gt,...Jt};const Kt=e.HS.executeBasedOnType(Jt,!1,(e=>t.lists.flipLists(e))),Qt=[];for(let e=0;e<2;e++)Qt.push({type:\\"flat\\"});const Ut=[{result:Kt,transformers:Qt}],$t={points:[void 0]};let _t={};_t.points=Vt,e.HS.updateListInputs(_t),_t={...$t,..._t};const es=[{result:await e.HS.executeBasedOnTypeAsync(_t,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}];let ts={};ts.listElements=Ut,e.HS.updateListInputs(ts),ts={...ts};const ss=[{result:[ts.listElements?ts.listElements:[]]}],ns={shape:[void 0],radius:[.3],radiusList:[void 0],indexes:[void 0]};let rs={};rs.shape=es,e.HS.updateListInputs(rs),rs={...ns,...rs};const as=[{result:await e.HS.executeBasedOnTypeAsync(rs,!1,(e=>t.occt.fillets.fillet2d(e))),transformers:[]}],os={points:[void 0]};let is={};is.points=ss,e.HS.updateListInputs(is),is={...os,...is};const cs=[{result:await e.HS.executeBasedOnTypeAsync(is,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}],ps={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let us={};us.shape=as,us.direction=x,e.HS.updateListInputs(us),us={...ps,...us};const ls=[{result:await e.HS.executeBasedOnTypeAsync(us,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}],ds={shape:[void 0]};let ms={};ms.shape=as,e.HS.updateListInputs(ms),ms={...ds,...ms};const ys=[{result:await e.HS.executeBasedOnTypeAsync(ms,!1,(e=>t.occt.shapes.wire.startPointOnWire(e))),transformers:[]}],Ss={shape:[void 0]};let Hs={};Hs.shape=as,e.HS.updateListInputs(Hs),Hs={...Ss,...Hs};const fs=[{result:await e.HS.executeBasedOnTypeAsync(Hs,!1,(e=>t.occt.shapes.wire.endPointOnWire(e))),transformers:[]}],hs={shape:[void 0]};let xs={};xs.shape=as,e.HS.updateListInputs(xs),xs={...hs,...xs};const vs=[{result:await e.HS.executeBasedOnTypeAsync(xs,!1,(e=>t.occt.shapes.wire.closeOpenWire(e))),transformers:[]}],Os={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let Is={};Is.shape=vs,Is.direction=x,e.HS.updateListInputs(Is),Is={...Os,...Is};const Ls=[{result:await e.HS.executeBasedOnTypeAsync(Is,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}],Bs={shape:[void 0],radius:[1],radiusList:[void 0],indexes:[void 0],direction:[[0,1,0]]};let ws={};ws.shape=cs,ws.direction=g,e.HS.updateListInputs(ws),ws={...Bs,...ws};const Ts=[{result:await e.HS.executeBasedOnTypeAsync(ws,!1,(e=>t.occt.fillets.fillet3DWire(e))),transformers:[]}],gs={shape:[void 0],face:[void 0],distance:[-.2],tolerance:[.1]};let As={};As.shape=ls,e.HS.updateListInputs(As),As={...gs,...As};const Es=[{result:await e.HS.executeBasedOnTypeAsync(As,!1,(e=>t.occt.operations.offset(e))),transformers:[]}],bs={shape:[void 0],index:[0]};let zs={};zs.shape=ls,e.HS.updateListInputs(zs),zs={...bs,...zs};const Ws=[{result:await e.HS.executeBasedOnTypeAsync(zs,!1,(e=>t.occt.shapes.wire.getWire(e))),transformers:[]}];let Cs={};Cs.item=ys,e.HS.updateListInputs(Cs),Cs={...Cs};const Ps=[{result:Cs.item}];let Xs={};Xs.item=fs,e.HS.updateListInputs(Xs),Xs={...Xs};const Ys=[{result:Xs.item}];let Zs={};Zs.start=fs,Zs.end=ys,e.HS.updateListInputs(Zs),Zs={start:[[0,0,0]],end:[[0,1,0]],...Zs};const Ns=[{result:await e.HS.executeBasedOnTypeAsync(Zs,!1,(e=>t.occt.shapes.wire.createLineWire(e))),transformers:[]}];e.HS.drawNodeMeshes(Ns,t);const ks={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let Ms={};Ms.shape=Ts,Ms.angle=ot,Ms.direction=o,e.HS.updateListInputs(Ms),Ms={...ks,...Ms};const Fs=[{result:await e.HS.executeBasedOnTypeAsync(Ms,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}],Ds={shape:[void 0]};let Rs={};Rs.shape=Ls,e.HS.updateListInputs(Rs),Rs={...Ds,...Rs};const js=[{result:await e.HS.executeBasedOnTypeAsync(Rs,!1,(e=>t.occt.shapes.solid.fromClosedShell(e))),transformers:[]}],qs={shape:[void 0],index:[1]};let Vs={};Vs.shape=Ws,e.HS.updateListInputs(Vs),Vs={...qs,...Vs};const Gs=[{result:await e.HS.executeBasedOnTypeAsync(Vs,!1,(e=>t.occt.shapes.edge.getEdge(e))),transformers:[]}],Js={shape:[void 0],index:[0]};let Ks={};Ks.shape=Es,e.HS.updateListInputs(Ks),Ks={...Js,...Ks};const Qs=[{result:await e.HS.executeBasedOnTypeAsync(Ks,!1,(e=>t.occt.shapes.wire.getWire(e))),transformers:[]}],Us={shape:[void 0],translation:[[0,0,0]]};let $s={};$s.shape=Ns,$s.translation=E,e.HS.updateListInputs($s),$s={...Us,...$s};const _s=[{result:await e.HS.executeBasedOnTypeAsync($s,!1,(e=>t.occt.transforms.translate(e))),transformers:[]}],en={shape:[void 0],direction:[[0,1,0]]};let tn={};tn.shape=Fs,tn.direction=Pe,e.HS.updateListInputs(tn),tn={...en,...tn};const sn=[{result:await e.HS.executeBasedOnTypeAsync(tn,!1,(e=>t.occt.operations.extrude(e))),transformers:[]}];let nn={};nn.listElements=js,e.HS.updateListInputs(nn),nn={...nn};const rn=[{result:[nn.listElements?nn.listElements:[]]}],an={shape:[void 0],index:[1]};let on={};on.shape=Qs,e.HS.updateListInputs(on),on={...an,...on};const cn=[{result:await e.HS.executeBasedOnTypeAsync(on,!1,(e=>t.occt.shapes.edge.getEdge(e))),transformers:[]}];let pn={};pn.listElements=Gs,e.HS.updateListInputs(pn),pn={...pn};const un=[{result:[pn.listElements?pn.listElements:[]]}],ln={shape:[void 0]};let dn={};dn.shape=_s,e.HS.updateListInputs(dn),dn={...ln,...dn};const mn=[{result:await e.HS.executeBasedOnTypeAsync(dn,!1,(e=>t.occt.shapes.wire.startPointOnWire(e))),transformers:[]}],yn={shape:[void 0]};let Sn={};Sn.shape=_s,e.HS.updateListInputs(Sn),Sn={...yn,...Sn};const Hn=[{result:await e.HS.executeBasedOnTypeAsync(Sn,!1,(e=>t.occt.shapes.wire.endPointOnWire(e))),transformers:[]}],fn={shapes:[void 0]};let hn={};hn.shapes=un,e.HS.updateListInputs(hn),hn={...fn,...hn};const xn=[{result:await e.HS.executeBasedOnTypeAsync(hn,!1,(e=>t.occt.shapes.wire.combineEdgesAndWiresIntoAWire(e))),transformers:[]}];let vn={};vn.listElements=cn,e.HS.updateListInputs(vn),vn={...vn};const On=[{result:[vn.listElements?vn.listElements:[]]}],In={shape:[void 0],shapes:[void 0],keepEdges:[!1]};let Ln={};Ln.shape=sn,Ln.shapes=Fe,e.HS.updateListInputs(Ln),Ln={...In,...Ln};const Bn=[{result:await e.HS.executeBasedOnTypeAsync(Ln,!1,(e=>t.occt.booleans.difference(e))),transformers:[]}];let wn={};wn.item=Hn,e.HS.updateListInputs(wn),wn={...wn};const Tn=[{result:wn.item}];let gn={};gn.item=mn,e.HS.updateListInputs(gn),gn={...gn};const An=[{result:gn.item}],En={shape:[void 0],shapes:[void 0],keepEdges:[!1]};let bn={};bn.shape=Bn,bn.shapes=rn,e.HS.updateListInputs(bn),bn={...En,...bn};const zn=[{result:await e.HS.executeBasedOnTypeAsync(bn,!1,(e=>t.occt.booleans.difference(e))),transformers:[]}],Wn={shapes:[void 0]};let Cn={};Cn.shapes=On,e.HS.updateListInputs(Cn),Cn={...Wn,...Cn};const Pn=[{result:await e.HS.executeBasedOnTypeAsync(Cn,!1,(e=>t.occt.shapes.wire.combineEdgesAndWiresIntoAWire(e))),transformers:[]}];let Xn={};Xn.listElements=[Ps[0],Tn[0],An[0],Ys[0]],e.HS.updateListInputs(Xn),Xn={...Xn};const Yn=[{result:[Xn.listElements?Xn.listElements:[]]}],Zn={shape:[void 0],origin:[[0,0,0]],normal:[[0,0,1]]};let Nn={};Nn.shape=zn,Nn.normal=m,e.HS.updateListInputs(Nn),Nn={...Zn,...Nn};const kn=[{result:await e.HS.executeBasedOnTypeAsync(Nn,!1,(e=>t.occt.transforms.mirrorAlongNormal(e))),transformers:[]}];let Mn={};Mn.listElements=[xn[0],Pn[0]],e.HS.updateListInputs(Mn),Mn={...Mn};const Fn=[{result:[Mn.listElements?Mn.listElements:[]]}],Dn={points:[void 0]};let Rn={};Rn.points=Yn,e.HS.updateListInputs(Rn),Rn={...Dn,...Rn};const jn=[{result:await e.HS.executeBasedOnTypeAsync(Rn,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}];let qn={};qn.listElements=[kn[0],zn[0]],e.HS.updateListInputs(qn),qn={...qn};const Vn=[{result:[qn.listElements?qn.listElements:[]]}],Gn={shapes:[void 0],makeSolid:[!1]};let Jn={};Jn.shapes=Fn,e.HS.updateListInputs(Jn),Jn={...Gn,...Jn};const Kn=[{result:await e.HS.executeBasedOnTypeAsync(Jn,!1,(e=>t.occt.operations.loft(e))),transformers:[]}],Qn={shape:[void 0],radius:[.5],radiusList:[void 0],indexes:[void 0]};let Un={};Un.shape=jn,e.HS.updateListInputs(Un),Un={...Qn,...Un};const $n=[{result:await e.HS.executeBasedOnTypeAsync(Un,!1,(e=>t.occt.fillets.fillet2d(e))),transformers:[]}],_n={shapes:[void 0]};let er={};er.shapes=Vn,e.HS.updateListInputs(er),er={..._n,...er};const tr=[{result:await e.HS.executeBasedOnTypeAsync(er,!1,(e=>t.occt.shapes.compound.makeCompound(e))),transformers:[]}],sr={shape:[void 0],origin:[[0,0,0]],direction:[[0,0,1]]};let nr={};nr.shape=Kn,nr.origin=We,nr.direction=f,e.HS.updateListInputs(nr),nr={...sr,...nr};const rr=[{result:await e.HS.executeBasedOnTypeAsync(nr,!1,(e=>t.occt.transforms.mirror(e))),transformers:[]}],ar={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let or={};or.shape=$n,or.direction=x,e.HS.updateListInputs(or),or={...ar,...or};const ir=[{result:await e.HS.executeBasedOnTypeAsync(or,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}];let cr={};cr.listElements=[ls[0],Es[0],Kn[0],rr[0]],e.HS.updateListInputs(cr),cr={...cr};const pr=[{result:[cr.listElements?cr.listElements:[]]}],ur={shape:[void 0],offset:[-.1]};let lr={};lr.shape=ir,e.HS.updateListInputs(lr),lr={...ur,...lr};const dr=[{result:await e.HS.executeBasedOnTypeAsync(lr,!1,(e=>t.occt.operations.makeThickSolidSimple(e))),transformers:[]}],mr={shape:[void 0],angle:[0],center:[[0,0,0]],axis:[[0,0,1]]};let yr={};yr.shape=tr,yr.angle=$e,yr.axis=k,e.HS.updateListInputs(yr),yr={...mr,...yr};const Sr=[{result:await e.HS.executeBasedOnTypeAsync(yr,!1,(e=>t.occt.transforms.rotateAroundCenter(e))),transformers:[]}],Hr={shapes:[void 0],tolerance:[1e-7]};let fr={};fr.shapes=pr,e.HS.updateListInputs(fr),fr={...Hr,...fr};const hr=[{result:await e.HS.executeBasedOnTypeAsync(fr,!1,(e=>t.occt.shapes.shell.sewFaces(e))),transformers:[]}],xr={entity:[void 0],options:[void 0],babylonMesh:[void 0]};let vr={};vr.entity=dr,vr.options=z,e.HS.updateListInputs(vr),vr={...xr,...vr};await e.HS.executeBasedOnTypeAsync(vr,!1,(e=>t.draw.drawAnyAsync(e)));let Or={};Or.listElements=Sr,e.HS.updateListInputs(Or),Or={...Or};const Ir=[{result:[Or.listElements?Or.listElements:[]]}],Lr={shapes:[void 0]};let Br={};Br.shapes=Ir,e.HS.updateListInputs(Br),Br={...Lr,...Br};const wr=[{result:await e.HS.executeBasedOnTypeAsync(Br,!1,(e=>t.occt.shapes.compound.makeCompound(e))),transformers:[]}];let Tr={};Tr.listElements=[hr[0],ve[0],wr[0]],e.HS.updateListInputs(Tr),Tr={...Tr};const gr=[{result:[Tr.listElements?Tr.listElements:[]]}],Ar={shapes:[void 0]};let Er={};Er.shapes=gr,e.HS.updateListInputs(Er),Er={...Ar,...Er};const br=[{result:await e.HS.executeBasedOnTypeAsync(Er,!1,(e=>t.occt.shapes.compound.makeCompound(e))),transformers:[]}],zr={entity:[void 0],options:[void 0],babylonMesh:[void 0]};let Wr={};Wr.entity=br,Wr.options=ne,e.HS.updateListInputs(Wr),Wr={...zr,...Wr};await e.HS.executeBasedOnTypeAsync(Wr,!1,(e=>t.draw.drawAnyAsync(e)))}(BitByBit,bitbybit,bitbybitRunnerResult,bitbybitRunnerInputs,Bit);\"}' }; + + + + + + + \ No newline at end of file diff --git a/examples/runner/playcanvas/full/simple/index.html b/examples/runner/playcanvas/full/simple/index.html new file mode 100644 index 00000000..d0e6f073 --- /dev/null +++ b/examples/runner/playcanvas/full/simple/index.html @@ -0,0 +1,174 @@ + + + + + Bitbybit Runner PlayCanvas Full Coding Example - Initiate Scene & Camera In Runner + + + + + + + + + + + +
+ +

Bitbybit Runner PlayCanvas Full Coding Example - Initiate Scene & Camera In Runner

+
+ +
+

+ This example shows how to import Full version of bitbybit runner for playcanvas and initiate scene with a + single call to runner. This full version does not require PlayCanvas to be loaded separately. Full version + of + bitbybit-dev bundle is larger. +

+
+ + + \ No newline at end of file diff --git a/examples/runner/playcanvas/lite/index.html b/examples/runner/playcanvas/lite/index.html new file mode 100644 index 00000000..20849ecb --- /dev/null +++ b/examples/runner/playcanvas/lite/index.html @@ -0,0 +1,178 @@ + + + + + Bitbybit Runner PlayCanvas Lite Coding Example - Initiate Scene & Camera In Runner + + + + + + + + + + + + + + +
+ +

Bitbybit Runner PlayCanvas Lite Coding Example - Initiate Scene & Camera In Runner

+
+ +
+

+ This example shows how to import Lite version of bitbybit runner for PlayCanvas and initiate scene with a + single call to runner. This lite version requires PlayCanvas to be loaded separately. Lite version of + bitbybit-dev bundle is smaller than non-lite. +

+
+ + + \ No newline at end of file diff --git a/examples/runner/threejs/full/inline-include/index.html b/examples/runner/threejs/full/inline-include/index.html index 82981e31..ea72425c 100644 --- a/examples/runner/threejs/full/inline-include/index.html +++ b/examples/runner/threejs/full/inline-include/index.html @@ -34,7 +34,7 @@ // This function simply outputs the script that was exported from the Rete editor by clicking "Export to Runner" and selecting Minify option. function exportedScript() { - return '{\"type\":\"rete\",\"version\":\"0.20.14\",\"script\":\"async function(e,t,s,n,r){let a={};a={x:[0],y:[0],z:[1],...a};const o=[{result:e.HS.executeBasedOnType(a,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let i={};i={text:[\\"[true,false]\\"],...i};const p=[{result:e.HS.executeBasedOnType(i,!1,(e=>t.json.parse(e))),transformers:[]}];let c={};c={text:[\\"[false,true]\\"],...c};const u=[{result:e.HS.executeBasedOnType(c,!1,(e=>t.json.parse(e))),transformers:[]}],l=[{result:[5],transformers:[]}];let d={};d={x:[1],y:[0],z:[0],...d};const m=[{result:e.HS.executeBasedOnType(d,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}],y=[{result:[12],transformers:[]}],S=[{result:[7],transformers:[]}];let H={};H={x:[0],y:[1],z:[0],...H};const f=[{result:e.HS.executeBasedOnType(H,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let h={};h={x:[0],y:[0],z:[1],...h};const x=[{result:e.HS.executeBasedOnType(h,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let v={};v={number:[.4],...v};const O=[{result:e.HS.executeBasedOnType(v,!1,(e=>t.math.number(e))),transformers:[]}];let I={};I={x:[0],y:[0],z:[-1],...I};const L=[{result:e.HS.executeBasedOnType(I,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let B={};B={x:[0],y:[0],z:[-2],...B};const T=[{result:e.HS.executeBasedOnType(B,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let w={};w={x:[0],y:[0],z:[1],...w};const A=[{result:e.HS.executeBasedOnType(w,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let E={};E={x:[0],y:[1.5],z:[0],...E};const g=[{result:e.HS.executeBasedOnType(E,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let b={};b={...{faceOpacity:[.5],edgeOpacity:[.5],edgeColour:[\\"#000000\\"],faceColour:[\\"#212121\\"],vertexColour:[\\"#ff00ff\\"],faceMaterial:[void 0],edgeWidth:[2],vertexSize:[.03],drawEdges:[!0],drawFaces:[!0],drawVertices:[!1],precision:[.02],drawEdgeIndexes:[!1],edgeIndexHeight:[.06],edgeIndexColour:[\\"ff00ff\\"],drawFaceIndexes:[!1],faceIndexHeight:[.06],faceIndexColour:[\\"#0000ff\\"]},...b};const W=[{result:e.HS.executeBasedOnType(b,!1,(e=>t.draw.optionsOcctShape(e))),transformers:[]}];let z={};z={x:[0],y:[0],z:[-1],...z};const P=[{result:e.HS.executeBasedOnType(z,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let X={};X={x:[0],y:[0],z:[-1.5],...X};const Y=[{result:e.HS.executeBasedOnType(X,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Z={};Z={x:[0],y:[0],z:[1],...Z};const N=[{result:e.HS.executeBasedOnType(Z,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let C={number:[{result:[20],transformers:[]}]};e.HS.updateListInputs(C),C={number:[20],...C};const k=[{result:e.HS.executeBasedOnType(C,!1,(e=>t.math.number(e))),transformers:[]}];let D={};D.y=y,e.HS.updateListInputs(D),D={x:[0],y:[0],z:[0],...D};const F=[{result:e.HS.executeBasedOnType(D,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let M={};M.item=y,e.HS.updateListInputs(M),M={...M};const R=[{result:M.item}];let j={};j.first=S,e.HS.updateListInputs(j),j={first:[1],second:[-2],operation:[\\"divide\\"],...j};const q=[{result:e.HS.executeBasedOnType(j,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let V={};V.first=S,e.HS.updateListInputs(V),V={first:[1],second:[-4],operation:[\\"divide\\"],...V};const G=[{result:e.HS.executeBasedOnType(V,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let J={};J.first=y,J.second=O,e.HS.updateListInputs(J),J={first:[1],second:[.4],operation:[\\"add\\"],...J};const K=[{result:e.HS.executeBasedOnType(J,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let Q={};Q.item=S,e.HS.updateListInputs(Q),Q={...Q};const U=[{result:Q.item}];let $={};$.center=Y,$.direction=P,e.HS.updateListInputs($),$={radius:[3],height:[1.9],center:[[0,0,0]],direction:[[0,1,0]],...$};const _=[{result:await e.HS.executeBasedOnTypeAsync($,!1,(e=>t.occt.shapes.solid.createCylinder(e))),transformers:[]}];let ee={};ee.y=K,e.HS.updateListInputs(ee),ee={x:[0],y:[12],z:[0],...ee};const te=[{result:e.HS.executeBasedOnType(ee,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let se={};se.first=k,e.HS.updateListInputs(se),se={first:[1],second:[3],operation:[\\"multiply\\"],...se};const ne=[{result:e.HS.executeBasedOnType(se,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let re={};re.first=R,re.second=O,e.HS.updateListInputs(re),re={first:[1],second:[.4],operation:[\\"add\\"],...re};const ae=[{result:e.HS.executeBasedOnType(re,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let oe={};oe.first=R,oe.second=O,e.HS.updateListInputs(oe),oe={first:[1],second:[.4],operation:[\\"subtract\\"],...oe};const ie=[{result:e.HS.executeBasedOnType(oe,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let pe={};pe.first=U,e.HS.updateListInputs(pe),pe={first:[1],second:[-.2],operation:[\\"multiply\\"],...pe};const ce=[{result:e.HS.executeBasedOnType(pe,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let ue={};ue.second=k,e.HS.updateListInputs(ue),ue={first:[360],second:[1],operation:[\\"divide\\"],...ue};const le=[{result:e.HS.executeBasedOnType(ue,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}],de={shape:[void 0],radius:[.3],radiusList:[void 0],indexes:[void 0]};let me={};me.shape=_,e.HS.updateListInputs(me),me={...de,...me};const ye=[{result:await e.HS.executeBasedOnTypeAsync(me,!1,(e=>t.occt.fillets.filletEdges(e))),transformers:[]}];let Se={};Se.start=L,Se.end=te,e.HS.updateListInputs(Se),Se={start:[[0,0,0]],end:[[0,1,0]],...Se};const He=[{result:await e.HS.executeBasedOnTypeAsync(Se,!1,(e=>t.occt.shapes.wire.createLineWire(e))),transformers:[]}];let fe={};fe.second=ne,e.HS.updateListInputs(fe),fe={first:[360],second:[1],operation:[\\"divide\\"],...fe};const he=[{result:e.HS.executeBasedOnType(fe,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let xe={};xe.start=T,xe.end=te,e.HS.updateListInputs(xe),xe={start:[[0,0,0]],end:[[0,1,0]],...xe};const ve=[{result:await e.HS.executeBasedOnTypeAsync(xe,!1,(e=>t.occt.shapes.wire.createLineWire(e))),transformers:[]}];let Oe={};Oe.y=ae,e.HS.updateListInputs(Oe),Oe={x:[0],y:[0],z:[.05],...Oe};const Ie=[{result:e.HS.executeBasedOnType(Oe,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Le={};Le.y=ie,Le.z=G,e.HS.updateListInputs(Le),Le={x:[0],y:[0],z:[-1],...Le};const Be=[{result:e.HS.executeBasedOnType(Le,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Te={};Te.y=ie,Te.z=q,e.HS.updateListInputs(Te),Te={x:[0],y:[0],z:[0],...Te};const we=[{result:e.HS.executeBasedOnType(Te,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Ae={};Ae.z=ce,e.HS.updateListInputs(Ae),Ae={x:[0],y:[0],z:[0],...Ae};const Ee=[{result:e.HS.executeBasedOnType(Ae,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let ge={};ge.step=le,e.HS.updateListInputs(ge),ge={step:[.1],min:[0],max:[360],...ge};const be=e.HS.executeBasedOnType(ge,!1,(e=>t.vector.span(e))),We=[];for(let e=0;e<1;e++)We.push({type:\\"flat\\"});const ze=[{result:be,transformers:We}];let Pe={};Pe.first=ce,e.HS.updateListInputs(Pe),Pe={first:[2],second:[-2],operation:[\\"multiply\\"],...Pe};e.HS.executeBasedOnType(Pe,!1,(e=>t.math.twoNrOperation(e)));let Xe={};Xe.listElements=ye,e.HS.updateListInputs(Xe),Xe={...Xe};const Ye=[{result:[Xe.listElements?Xe.listElements:[]]}],Ze={shape:[void 0],axis:[[0,0,1]],angle:[0]};let Ne={};Ne.shape=He,Ne.axis=o,Ne.angle=he,e.HS.updateListInputs(Ne),Ne={...Ze,...Ne};const Ce=[{result:await e.HS.executeBasedOnTypeAsync(Ne,!1,(e=>t.occt.transforms.rotate(e))),transformers:[]}];let ke={};ke.first=he,e.HS.updateListInputs(ke),ke={first:[1],second:[.4],operation:[\\"multiply\\"],...ke};const De=[{result:e.HS.executeBasedOnType(ke,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let Fe={};Fe.first=he,e.HS.updateListInputs(Fe),Fe={first:[1],second:[.6],operation:[\\"multiply\\"],...Fe};const Me=[{result:e.HS.executeBasedOnType(Fe,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let Re={};Re.listElements=[Ie[0],F[0],Be[0],we[0]],e.HS.updateListInputs(Re),Re={...Re};const je=[{result:[Re.listElements?Re.listElements:[]]}];let qe={};qe.item=ze,e.HS.updateListInputs(qe),qe={...qe};const Ve=[{result:qe.item}],Ge={shape:[void 0],nrOfDivisions:[11],removeStartPoint:[!1],removeEndPoint:[!1]};let Je={};Je.shape=Ce,Je.nrOfDivisions=l,e.HS.updateListInputs(Je),Je={...Ge,...Je};const Ke=[{result:await e.HS.executeBasedOnTypeAsync(Je,!1,(e=>t.occt.shapes.wire.divideWireByEqualDistanceToPoints(e))),transformers:[]}],Qe={shape:[void 0],axis:[[0,0,1]],angle:[0]};let Ue={};Ue.shape=ve,Ue.axis=o,Ue.angle=[De[0],Me[0]],e.HS.updateListInputs(Ue),Ue={...Qe,...Ue};const $e=[{result:await e.HS.executeBasedOnTypeAsync(Ue,!1,(e=>t.occt.transforms.rotate(e))),transformers:[]}];let _e={};_e.number=De,e.HS.updateListInputs(_e),_e={number:[1],operation:[\\"negate\\"],..._e};const et=[{result:e.HS.executeBasedOnType(_e,!1,(e=>t.math.oneNrOperation(e))),transformers:[]}],tt={points:[void 0]};let st={};st.points=je,e.HS.updateListInputs(st),st={...tt,...st};const nt=[{result:await e.HS.executeBasedOnTypeAsync(st,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}],rt={list:[void 0],pattern:[[!0,!0,!1]]};let at={};at.list=Ke,at.pattern=u,e.HS.updateListInputs(at),at={...rt,...at};const ot=[{result:e.HS.executeBasedOnType(at,!0,(e=>t.lists.getByPattern(e))),transformers:[]}];let it={};it.listElements=$e,e.HS.updateListInputs(it),it={...it};const pt=[{result:[it.listElements?it.listElements:[]]}],ct={shape:[void 0],origin:[[0,0,0]],direction:[[0,0,1]]};let ut={};ut.shape=nt,ut.origin=we,ut.direction=f,e.HS.updateListInputs(ut),ut={...ct,...ut};const lt=[{result:await e.HS.executeBasedOnTypeAsync(ut,!1,(e=>t.occt.transforms.mirror(e))),transformers:[]}],dt={shape:[void 0]};let mt={};mt.shape=nt,e.HS.updateListInputs(mt),mt={...dt,...mt};const yt=await e.HS.executeBasedOnTypeAsync(mt,!1,(e=>t.occt.shapes.edge.getCornerPointsOfEdgesForShape(e))),St=[];for(let e=0;e<1;e++)St.push({type:\\"flat\\"});const Ht=[{result:yt,transformers:St}],ft={list:[void 0],index:[0],clone:[!0]};let ht={};ht.list=pt,e.HS.updateListInputs(ht),ht={...ft,...ht};const xt=[{result:e.HS.executeBasedOnType(ht,!1,(e=>t.lists.getItem(e))),transformers:[]}],vt={shape:[void 0]};let Ot={};Ot.shape=lt,e.HS.updateListInputs(Ot),Ot={...vt,...Ot};const It=[{result:await e.HS.executeBasedOnTypeAsync(Ot,!1,(e=>t.occt.shapes.edge.getCornerPointsOfEdgesForShape(e))),transformers:[]}],Lt={shape:[void 0],nrOfDivisions:[11],removeStartPoint:[!1],removeEndPoint:[!1]};let Bt={};Bt.shape=xt,Bt.nrOfDivisions=l,e.HS.updateListInputs(Bt),Bt={...Lt,...Bt};const Tt=[{result:await e.HS.executeBasedOnTypeAsync(Bt,!1,(e=>t.occt.shapes.wire.divideWireByEqualDistanceToPoints(e))),transformers:[]}],wt={list:[void 0],index:[3],clone:[!0]};let At={};At.list=It,e.HS.updateListInputs(At),At={...wt,...At};const Et=[{result:e.HS.executeBasedOnType(At,!1,(e=>t.lists.removeItemAtIndex(e))),transformers:[]}],gt={list:[void 0],pattern:[[!0,!0,!1]]};let bt={};bt.list=Tt,bt.pattern=p,e.HS.updateListInputs(bt),bt={...gt,...bt};const Wt=[{result:e.HS.executeBasedOnType(bt,!1,(e=>t.lists.getByPattern(e))),transformers:[]}],zt={list:[void 0],clone:[!0]};let Pt={};Pt.list=Et,e.HS.updateListInputs(Pt),Pt={...zt,...Pt};const Xt=e.HS.executeBasedOnType(Pt,!1,(e=>t.lists.reverse(e))),Yt=[];for(let e=0;e<1;e++)Yt.push({type:\\"flat\\"});const Zt=[{result:Xt,transformers:Yt}];let Nt={};Nt.listElements=[Wt[0],ot[0]],e.HS.updateListInputs(Nt),Nt={...Nt};const Ct=[{result:[Nt.listElements?Nt.listElements:[]]}];let kt={};kt.listElements=[Ht[0],Zt[0]],e.HS.updateListInputs(kt),kt={...kt};const Dt=[{result:[kt.listElements?kt.listElements:[]]}],Ft={list:[void 0],clone:[!0]};let Mt={};Mt.list=Ct,e.HS.updateListInputs(Mt),Mt={...Ft,...Mt};const Rt=e.HS.executeBasedOnType(Mt,!1,(e=>t.lists.flipLists(e))),jt=[];for(let e=0;e<2;e++)jt.push({type:\\"flat\\"});const qt=[{result:Rt,transformers:jt}],Vt={points:[void 0]};let Gt={};Gt.points=Dt,e.HS.updateListInputs(Gt),Gt={...Vt,...Gt};const Jt=[{result:await e.HS.executeBasedOnTypeAsync(Gt,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}];let Kt={};Kt.listElements=qt,e.HS.updateListInputs(Kt),Kt={...Kt};const Qt=[{result:[Kt.listElements?Kt.listElements:[]]}],Ut={shape:[void 0],radius:[.3],radiusList:[void 0],indexes:[void 0]};let $t={};$t.shape=Jt,e.HS.updateListInputs($t),$t={...Ut,...$t};const _t=[{result:await e.HS.executeBasedOnTypeAsync($t,!1,(e=>t.occt.fillets.fillet2d(e))),transformers:[]}],es={points:[void 0]};let ts={};ts.points=Qt,e.HS.updateListInputs(ts),ts={...es,...ts};const ss=[{result:await e.HS.executeBasedOnTypeAsync(ts,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}],ns={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let rs={};rs.shape=_t,rs.direction=x,e.HS.updateListInputs(rs),rs={...ns,...rs};const as=[{result:await e.HS.executeBasedOnTypeAsync(rs,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}],os={shape:[void 0]};let is={};is.shape=_t,e.HS.updateListInputs(is),is={...os,...is};const ps=[{result:await e.HS.executeBasedOnTypeAsync(is,!1,(e=>t.occt.shapes.wire.startPointOnWire(e))),transformers:[]}],cs={shape:[void 0]};let us={};us.shape=_t,e.HS.updateListInputs(us),us={...cs,...us};const ls=[{result:await e.HS.executeBasedOnTypeAsync(us,!1,(e=>t.occt.shapes.wire.endPointOnWire(e))),transformers:[]}],ds={shape:[void 0]};let ms={};ms.shape=_t,e.HS.updateListInputs(ms),ms={...ds,...ms};const ys=[{result:await e.HS.executeBasedOnTypeAsync(ms,!1,(e=>t.occt.shapes.wire.closeOpenWire(e))),transformers:[]}],Ss={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let Hs={};Hs.shape=ys,Hs.direction=x,e.HS.updateListInputs(Hs),Hs={...Ss,...Hs};const fs=[{result:await e.HS.executeBasedOnTypeAsync(Hs,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}],hs={shape:[void 0],radius:[1],radiusList:[void 0],indexes:[void 0],direction:[[0,1,0]]};let xs={};xs.shape=ss,xs.direction=A,e.HS.updateListInputs(xs),xs={...hs,...xs};const vs=[{result:await e.HS.executeBasedOnTypeAsync(xs,!1,(e=>t.occt.fillets.fillet3DWire(e))),transformers:[]}],Os={shape:[void 0],face:[void 0],distance:[-.2],tolerance:[.1]};let Is={};Is.shape=as,e.HS.updateListInputs(Is),Is={...Os,...Is};const Ls=[{result:await e.HS.executeBasedOnTypeAsync(Is,!1,(e=>t.occt.operations.offset(e))),transformers:[]}],Bs={shape:[void 0],index:[0]};let Ts={};Ts.shape=as,e.HS.updateListInputs(Ts),Ts={...Bs,...Ts};const ws=[{result:await e.HS.executeBasedOnTypeAsync(Ts,!1,(e=>t.occt.shapes.wire.getWire(e))),transformers:[]}];let As={};As.item=ps,e.HS.updateListInputs(As),As={...As};const Es=[{result:As.item}];let gs={};gs.item=ls,e.HS.updateListInputs(gs),gs={...gs};const bs=[{result:gs.item}];let Ws={};Ws.start=ls,Ws.end=ps,e.HS.updateListInputs(Ws),Ws={start:[[0,0,0]],end:[[0,1,0]],...Ws};const zs=[{result:await e.HS.executeBasedOnTypeAsync(Ws,!1,(e=>t.occt.shapes.wire.createLineWire(e))),transformers:[]}],Ps={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let Xs={};Xs.shape=vs,Xs.angle=et,Xs.direction=o,e.HS.updateListInputs(Xs),Xs={...Ps,...Xs};const Ys=[{result:await e.HS.executeBasedOnTypeAsync(Xs,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}],Zs={shape:[void 0]};let Ns={};Ns.shape=fs,e.HS.updateListInputs(Ns),Ns={...Zs,...Ns};const Cs=[{result:await e.HS.executeBasedOnTypeAsync(Ns,!1,(e=>t.occt.shapes.solid.fromClosedShell(e))),transformers:[]}],ks={shape:[void 0],index:[1]};let Ds={};Ds.shape=ws,e.HS.updateListInputs(Ds),Ds={...ks,...Ds};const Fs=[{result:await e.HS.executeBasedOnTypeAsync(Ds,!1,(e=>t.occt.shapes.edge.getEdge(e))),transformers:[]}],Ms={shape:[void 0],index:[0]};let Rs={};Rs.shape=Ls,e.HS.updateListInputs(Rs),Rs={...Ms,...Rs};const js=[{result:await e.HS.executeBasedOnTypeAsync(Rs,!1,(e=>t.occt.shapes.wire.getWire(e))),transformers:[]}],qs={shape:[void 0],translation:[[0,0,0]]};let Vs={};Vs.shape=zs,Vs.translation=g,e.HS.updateListInputs(Vs),Vs={...qs,...Vs};const Gs=[{result:await e.HS.executeBasedOnTypeAsync(Vs,!1,(e=>t.occt.transforms.translate(e))),transformers:[]}],Js={shape:[void 0],direction:[[0,1,0]]};let Ks={};Ks.shape=Ys,Ks.direction=Ee,e.HS.updateListInputs(Ks),Ks={...Js,...Ks};const Qs=[{result:await e.HS.executeBasedOnTypeAsync(Ks,!1,(e=>t.occt.operations.extrude(e))),transformers:[]}];let Us={};Us.listElements=Cs,e.HS.updateListInputs(Us),Us={...Us};const $s=[{result:[Us.listElements?Us.listElements:[]]}],_s={shape:[void 0],index:[1]};let en={};en.shape=js,e.HS.updateListInputs(en),en={..._s,...en};const tn=[{result:await e.HS.executeBasedOnTypeAsync(en,!1,(e=>t.occt.shapes.edge.getEdge(e))),transformers:[]}];let sn={};sn.listElements=Fs,e.HS.updateListInputs(sn),sn={...sn};const nn=[{result:[sn.listElements?sn.listElements:[]]}],rn={shape:[void 0]};let an={};an.shape=Gs,e.HS.updateListInputs(an),an={...rn,...an};const on=[{result:await e.HS.executeBasedOnTypeAsync(an,!1,(e=>t.occt.shapes.wire.startPointOnWire(e))),transformers:[]}],pn={shape:[void 0]};let cn={};cn.shape=Gs,e.HS.updateListInputs(cn),cn={...pn,...cn};const un=[{result:await e.HS.executeBasedOnTypeAsync(cn,!1,(e=>t.occt.shapes.wire.endPointOnWire(e))),transformers:[]}],ln={shapes:[void 0]};let dn={};dn.shapes=nn,e.HS.updateListInputs(dn),dn={...ln,...dn};const mn=[{result:await e.HS.executeBasedOnTypeAsync(dn,!1,(e=>t.occt.shapes.wire.combineEdgesAndWiresIntoAWire(e))),transformers:[]}];let yn={};yn.listElements=tn,e.HS.updateListInputs(yn),yn={...yn};const Sn=[{result:[yn.listElements?yn.listElements:[]]}],Hn={shape:[void 0],shapes:[void 0],keepEdges:[!1]};let fn={};fn.shape=Qs,fn.shapes=Ye,e.HS.updateListInputs(fn),fn={...Hn,...fn};const hn=[{result:await e.HS.executeBasedOnTypeAsync(fn,!1,(e=>t.occt.booleans.difference(e))),transformers:[]}];let xn={};xn.item=un,e.HS.updateListInputs(xn),xn={...xn};const vn=[{result:xn.item}];let On={};On.item=on,e.HS.updateListInputs(On),On={...On};const In=[{result:On.item}],Ln={shape:[void 0],shapes:[void 0],keepEdges:[!1]};let Bn={};Bn.shape=hn,Bn.shapes=$s,e.HS.updateListInputs(Bn),Bn={...Ln,...Bn};const Tn=[{result:await e.HS.executeBasedOnTypeAsync(Bn,!1,(e=>t.occt.booleans.difference(e))),transformers:[]}],wn={shapes:[void 0]};let An={};An.shapes=Sn,e.HS.updateListInputs(An),An={...wn,...An};const En=[{result:await e.HS.executeBasedOnTypeAsync(An,!1,(e=>t.occt.shapes.wire.combineEdgesAndWiresIntoAWire(e))),transformers:[]}];let gn={};gn.listElements=[Es[0],vn[0],In[0],bs[0]],e.HS.updateListInputs(gn),gn={...gn};const bn=[{result:[gn.listElements?gn.listElements:[]]}],Wn={shape:[void 0],origin:[[0,0,0]],normal:[[0,0,1]]};let zn={};zn.shape=Tn,zn.normal=m,e.HS.updateListInputs(zn),zn={...Wn,...zn};const Pn=[{result:await e.HS.executeBasedOnTypeAsync(zn,!1,(e=>t.occt.transforms.mirrorAlongNormal(e))),transformers:[]}];let Xn={};Xn.listElements=[mn[0],En[0]],e.HS.updateListInputs(Xn),Xn={...Xn};const Yn=[{result:[Xn.listElements?Xn.listElements:[]]}],Zn={points:[void 0]};let Nn={};Nn.points=bn,e.HS.updateListInputs(Nn),Nn={...Zn,...Nn};const Cn=[{result:await e.HS.executeBasedOnTypeAsync(Nn,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}];let kn={};kn.listElements=[Pn[0],Tn[0]],e.HS.updateListInputs(kn),kn={...kn};const Dn=[{result:[kn.listElements?kn.listElements:[]]}],Fn={shapes:[void 0],makeSolid:[!1]};let Mn={};Mn.shapes=Yn,e.HS.updateListInputs(Mn),Mn={...Fn,...Mn};const Rn=[{result:await e.HS.executeBasedOnTypeAsync(Mn,!1,(e=>t.occt.operations.loft(e))),transformers:[]}],jn={shape:[void 0],radius:[.5],radiusList:[void 0],indexes:[void 0]};let qn={};qn.shape=Cn,e.HS.updateListInputs(qn),qn={...jn,...qn};const Vn=[{result:await e.HS.executeBasedOnTypeAsync(qn,!1,(e=>t.occt.fillets.fillet2d(e))),transformers:[]}],Gn={shapes:[void 0]};let Jn={};Jn.shapes=Dn,e.HS.updateListInputs(Jn),Jn={...Gn,...Jn};const Kn=[{result:await e.HS.executeBasedOnTypeAsync(Jn,!1,(e=>t.occt.shapes.compound.makeCompound(e))),transformers:[]}],Qn={shape:[void 0],origin:[[0,0,0]],direction:[[0,0,1]]};let Un={};Un.shape=Rn,Un.origin=we,Un.direction=f,e.HS.updateListInputs(Un),Un={...Qn,...Un};const $n=[{result:await e.HS.executeBasedOnTypeAsync(Un,!1,(e=>t.occt.transforms.mirror(e))),transformers:[]}],_n={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let er={};er.shape=Vn,er.direction=x,e.HS.updateListInputs(er),er={..._n,...er};const tr=[{result:await e.HS.executeBasedOnTypeAsync(er,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}];let sr={};sr.listElements=[as[0],Ls[0],Rn[0],$n[0]],e.HS.updateListInputs(sr),sr={...sr};const nr=[{result:[sr.listElements?sr.listElements:[]]}],rr={shape:[void 0],offset:[-.1]};let ar={};ar.shape=tr,e.HS.updateListInputs(ar),ar={...rr,...ar};const or=[{result:await e.HS.executeBasedOnTypeAsync(ar,!1,(e=>t.occt.operations.makeThickSolidSimple(e))),transformers:[]}],ir={shape:[void 0],angle:[0],center:[[0,0,0]],axis:[[0,0,1]]};let pr={};pr.shape=Kn,pr.angle=Ve,pr.axis=N,e.HS.updateListInputs(pr),pr={...ir,...pr};const cr=[{result:await e.HS.executeBasedOnTypeAsync(pr,!1,(e=>t.occt.transforms.rotateAroundCenter(e))),transformers:[]}],ur={shapes:[void 0],tolerance:[1e-7]};let lr={};lr.shapes=nr,e.HS.updateListInputs(lr),lr={...ur,...lr};const dr=[{result:await e.HS.executeBasedOnTypeAsync(lr,!1,(e=>t.occt.shapes.shell.sewFaces(e))),transformers:[]}],mr={entity:[void 0],options:[void 0],babylonMesh:[void 0]};let yr={};yr.entity=or,yr.options=W,e.HS.updateListInputs(yr),yr={...mr,...yr};await e.HS.executeBasedOnTypeAsync(yr,!1,(e=>t.draw.drawAnyAsync(e)));let Sr={};Sr.listElements=cr,e.HS.updateListInputs(Sr),Sr={...Sr};const Hr=[{result:[Sr.listElements?Sr.listElements:[]]}],fr={shapes:[void 0]};let hr={};hr.shapes=Hr,e.HS.updateListInputs(hr),hr={...fr,...hr};const xr=[{result:await e.HS.executeBasedOnTypeAsync(hr,!1,(e=>t.occt.shapes.compound.makeCompound(e))),transformers:[]}];let vr={};vr.listElements=[dr[0],ye[0],xr[0]],e.HS.updateListInputs(vr),vr={...vr};const Or=[{result:[vr.listElements?vr.listElements:[]]}],Ir={shapes:[void 0]};let Lr={};Lr.shapes=Or,e.HS.updateListInputs(Lr),Lr={...Ir,...Lr};const Br=[{result:await e.HS.executeBasedOnTypeAsync(Lr,!1,(e=>t.occt.shapes.compound.makeCompound(e))),transformers:[]}],Tr={entity:[void 0],options:[void 0],babylonMesh:[void 0]};let wr={};wr.entity=Br,e.HS.updateListInputs(wr),wr={...Tr,...wr};await e.HS.executeBasedOnTypeAsync(wr,!1,(e=>t.draw.drawAnyAsync(e)))}(BitByBit,bitbybit,bitbybitRunnerResult,bitbybitRunnerInputs,Bit);\"}' + return '{\"type\":\"rete\",\"version\":\"0.21.0\",\"script\":\"async function(e,t,s,n,r){let a={};a={x:[0],y:[0],z:[1],...a};const o=[{result:e.HS.executeBasedOnType(a,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let i={};i={text:[\\"[true,false]\\"],...i};const p=[{result:e.HS.executeBasedOnType(i,!1,(e=>t.json.parse(e))),transformers:[]}];let c={};c={text:[\\"[false,true]\\"],...c};const u=[{result:e.HS.executeBasedOnType(c,!1,(e=>t.json.parse(e))),transformers:[]}],l=[{result:[5],transformers:[]}];let d={};d={x:[1],y:[0],z:[0],...d};const m=[{result:e.HS.executeBasedOnType(d,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}],y=[{result:[12],transformers:[]}],S=[{result:[7],transformers:[]}];let H={};H={x:[0],y:[1],z:[0],...H};const f=[{result:e.HS.executeBasedOnType(H,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let h={};h={x:[0],y:[0],z:[1],...h};const x=[{result:e.HS.executeBasedOnType(h,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let v={};v={number:[.4],...v};const O=[{result:e.HS.executeBasedOnType(v,!1,(e=>t.math.number(e))),transformers:[]}];let I={};I={x:[0],y:[0],z:[-1],...I};const L=[{result:e.HS.executeBasedOnType(I,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let B={};B={x:[0],y:[0],z:[-2],...B};const T=[{result:e.HS.executeBasedOnType(B,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let w={};w={x:[0],y:[0],z:[1],...w};const A=[{result:e.HS.executeBasedOnType(w,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let E={};E={x:[0],y:[1.5],z:[0],...E};const g=[{result:e.HS.executeBasedOnType(E,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let b={};b={...{faceOpacity:[.5],edgeOpacity:[.5],edgeColour:[\\"#000000\\"],faceColour:[\\"#212121\\"],vertexColour:[\\"#ff00ff\\"],faceMaterial:[void 0],edgeWidth:[2],vertexSize:[.03],drawEdges:[!0],drawFaces:[!0],drawVertices:[!1],precision:[.02],drawEdgeIndexes:[!1],edgeIndexHeight:[.06],edgeIndexColour:[\\"ff00ff\\"],drawFaceIndexes:[!1],faceIndexHeight:[.06],faceIndexColour:[\\"#0000ff\\"]},...b};const W=[{result:e.HS.executeBasedOnType(b,!1,(e=>t.draw.optionsOcctShape(e))),transformers:[]}];let z={};z={x:[0],y:[0],z:[-1],...z};const P=[{result:e.HS.executeBasedOnType(z,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let X={};X={x:[0],y:[0],z:[-1.5],...X};const Y=[{result:e.HS.executeBasedOnType(X,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Z={};Z={x:[0],y:[0],z:[1],...Z};const N=[{result:e.HS.executeBasedOnType(Z,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let C={number:[{result:[20],transformers:[]}]};e.HS.updateListInputs(C),C={number:[20],...C};const k=[{result:e.HS.executeBasedOnType(C,!1,(e=>t.math.number(e))),transformers:[]}];let D={};D.y=y,e.HS.updateListInputs(D),D={x:[0],y:[0],z:[0],...D};const F=[{result:e.HS.executeBasedOnType(D,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let M={};M.item=y,e.HS.updateListInputs(M),M={...M};const R=[{result:M.item}];let j={};j.first=S,e.HS.updateListInputs(j),j={first:[1],second:[-2],operation:[\\"divide\\"],...j};const q=[{result:e.HS.executeBasedOnType(j,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let V={};V.first=S,e.HS.updateListInputs(V),V={first:[1],second:[-4],operation:[\\"divide\\"],...V};const G=[{result:e.HS.executeBasedOnType(V,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let J={};J.first=y,J.second=O,e.HS.updateListInputs(J),J={first:[1],second:[.4],operation:[\\"add\\"],...J};const K=[{result:e.HS.executeBasedOnType(J,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let Q={};Q.item=S,e.HS.updateListInputs(Q),Q={...Q};const U=[{result:Q.item}];let $={};$.center=Y,$.direction=P,e.HS.updateListInputs($),$={radius:[3],height:[1.9],center:[[0,0,0]],direction:[[0,1,0]],...$};const _=[{result:await e.HS.executeBasedOnTypeAsync($,!1,(e=>t.occt.shapes.solid.createCylinder(e))),transformers:[]}];let ee={};ee.y=K,e.HS.updateListInputs(ee),ee={x:[0],y:[12],z:[0],...ee};const te=[{result:e.HS.executeBasedOnType(ee,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let se={};se.first=k,e.HS.updateListInputs(se),se={first:[1],second:[3],operation:[\\"multiply\\"],...se};const ne=[{result:e.HS.executeBasedOnType(se,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let re={};re.first=R,re.second=O,e.HS.updateListInputs(re),re={first:[1],second:[.4],operation:[\\"add\\"],...re};const ae=[{result:e.HS.executeBasedOnType(re,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let oe={};oe.first=R,oe.second=O,e.HS.updateListInputs(oe),oe={first:[1],second:[.4],operation:[\\"subtract\\"],...oe};const ie=[{result:e.HS.executeBasedOnType(oe,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let pe={};pe.first=U,e.HS.updateListInputs(pe),pe={first:[1],second:[-.2],operation:[\\"multiply\\"],...pe};const ce=[{result:e.HS.executeBasedOnType(pe,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let ue={};ue.second=k,e.HS.updateListInputs(ue),ue={first:[360],second:[1],operation:[\\"divide\\"],...ue};const le=[{result:e.HS.executeBasedOnType(ue,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}],de={shape:[void 0],radius:[.3],radiusList:[void 0],indexes:[void 0]};let me={};me.shape=_,e.HS.updateListInputs(me),me={...de,...me};const ye=[{result:await e.HS.executeBasedOnTypeAsync(me,!1,(e=>t.occt.fillets.filletEdges(e))),transformers:[]}];let Se={};Se.start=L,Se.end=te,e.HS.updateListInputs(Se),Se={start:[[0,0,0]],end:[[0,1,0]],...Se};const He=[{result:await e.HS.executeBasedOnTypeAsync(Se,!1,(e=>t.occt.shapes.wire.createLineWire(e))),transformers:[]}];let fe={};fe.second=ne,e.HS.updateListInputs(fe),fe={first:[360],second:[1],operation:[\\"divide\\"],...fe};const he=[{result:e.HS.executeBasedOnType(fe,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let xe={};xe.start=T,xe.end=te,e.HS.updateListInputs(xe),xe={start:[[0,0,0]],end:[[0,1,0]],...xe};const ve=[{result:await e.HS.executeBasedOnTypeAsync(xe,!1,(e=>t.occt.shapes.wire.createLineWire(e))),transformers:[]}];let Oe={};Oe.y=ae,e.HS.updateListInputs(Oe),Oe={x:[0],y:[0],z:[.05],...Oe};const Ie=[{result:e.HS.executeBasedOnType(Oe,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Le={};Le.y=ie,Le.z=G,e.HS.updateListInputs(Le),Le={x:[0],y:[0],z:[-1],...Le};const Be=[{result:e.HS.executeBasedOnType(Le,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Te={};Te.y=ie,Te.z=q,e.HS.updateListInputs(Te),Te={x:[0],y:[0],z:[0],...Te};const we=[{result:e.HS.executeBasedOnType(Te,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Ae={};Ae.z=ce,e.HS.updateListInputs(Ae),Ae={x:[0],y:[0],z:[0],...Ae};const Ee=[{result:e.HS.executeBasedOnType(Ae,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let ge={};ge.step=le,e.HS.updateListInputs(ge),ge={step:[.1],min:[0],max:[360],...ge};const be=e.HS.executeBasedOnType(ge,!1,(e=>t.vector.span(e))),We=[];for(let e=0;e<1;e++)We.push({type:\\"flat\\"});const ze=[{result:be,transformers:We}];let Pe={};Pe.first=ce,e.HS.updateListInputs(Pe),Pe={first:[2],second:[-2],operation:[\\"multiply\\"],...Pe};e.HS.executeBasedOnType(Pe,!1,(e=>t.math.twoNrOperation(e)));let Xe={};Xe.listElements=ye,e.HS.updateListInputs(Xe),Xe={...Xe};const Ye=[{result:[Xe.listElements?Xe.listElements:[]]}],Ze={shape:[void 0],axis:[[0,0,1]],angle:[0]};let Ne={};Ne.shape=He,Ne.axis=o,Ne.angle=he,e.HS.updateListInputs(Ne),Ne={...Ze,...Ne};const Ce=[{result:await e.HS.executeBasedOnTypeAsync(Ne,!1,(e=>t.occt.transforms.rotate(e))),transformers:[]}];let ke={};ke.first=he,e.HS.updateListInputs(ke),ke={first:[1],second:[.4],operation:[\\"multiply\\"],...ke};const De=[{result:e.HS.executeBasedOnType(ke,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let Fe={};Fe.first=he,e.HS.updateListInputs(Fe),Fe={first:[1],second:[.6],operation:[\\"multiply\\"],...Fe};const Me=[{result:e.HS.executeBasedOnType(Fe,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let Re={};Re.listElements=[Ie[0],F[0],Be[0],we[0]],e.HS.updateListInputs(Re),Re={...Re};const je=[{result:[Re.listElements?Re.listElements:[]]}];let qe={};qe.item=ze,e.HS.updateListInputs(qe),qe={...qe};const Ve=[{result:qe.item}],Ge={shape:[void 0],nrOfDivisions:[11],removeStartPoint:[!1],removeEndPoint:[!1]};let Je={};Je.shape=Ce,Je.nrOfDivisions=l,e.HS.updateListInputs(Je),Je={...Ge,...Je};const Ke=[{result:await e.HS.executeBasedOnTypeAsync(Je,!1,(e=>t.occt.shapes.wire.divideWireByEqualDistanceToPoints(e))),transformers:[]}],Qe={shape:[void 0],axis:[[0,0,1]],angle:[0]};let Ue={};Ue.shape=ve,Ue.axis=o,Ue.angle=[De[0],Me[0]],e.HS.updateListInputs(Ue),Ue={...Qe,...Ue};const $e=[{result:await e.HS.executeBasedOnTypeAsync(Ue,!1,(e=>t.occt.transforms.rotate(e))),transformers:[]}];let _e={};_e.number=De,e.HS.updateListInputs(_e),_e={number:[1],operation:[\\"negate\\"],..._e};const et=[{result:e.HS.executeBasedOnType(_e,!1,(e=>t.math.oneNrOperation(e))),transformers:[]}],tt={points:[void 0]};let st={};st.points=je,e.HS.updateListInputs(st),st={...tt,...st};const nt=[{result:await e.HS.executeBasedOnTypeAsync(st,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}],rt={list:[void 0],pattern:[[!0,!0,!1]]};let at={};at.list=Ke,at.pattern=u,e.HS.updateListInputs(at),at={...rt,...at};const ot=[{result:e.HS.executeBasedOnType(at,!0,(e=>t.lists.getByPattern(e))),transformers:[]}];let it={};it.listElements=$e,e.HS.updateListInputs(it),it={...it};const pt=[{result:[it.listElements?it.listElements:[]]}],ct={shape:[void 0],origin:[[0,0,0]],direction:[[0,0,1]]};let ut={};ut.shape=nt,ut.origin=we,ut.direction=f,e.HS.updateListInputs(ut),ut={...ct,...ut};const lt=[{result:await e.HS.executeBasedOnTypeAsync(ut,!1,(e=>t.occt.transforms.mirror(e))),transformers:[]}],dt={shape:[void 0]};let mt={};mt.shape=nt,e.HS.updateListInputs(mt),mt={...dt,...mt};const yt=await e.HS.executeBasedOnTypeAsync(mt,!1,(e=>t.occt.shapes.edge.getCornerPointsOfEdgesForShape(e))),St=[];for(let e=0;e<1;e++)St.push({type:\\"flat\\"});const Ht=[{result:yt,transformers:St}],ft={list:[void 0],index:[0],clone:[!0]};let ht={};ht.list=pt,e.HS.updateListInputs(ht),ht={...ft,...ht};const xt=[{result:e.HS.executeBasedOnType(ht,!1,(e=>t.lists.getItem(e))),transformers:[]}],vt={shape:[void 0]};let Ot={};Ot.shape=lt,e.HS.updateListInputs(Ot),Ot={...vt,...Ot};const It=[{result:await e.HS.executeBasedOnTypeAsync(Ot,!1,(e=>t.occt.shapes.edge.getCornerPointsOfEdgesForShape(e))),transformers:[]}],Lt={shape:[void 0],nrOfDivisions:[11],removeStartPoint:[!1],removeEndPoint:[!1]};let Bt={};Bt.shape=xt,Bt.nrOfDivisions=l,e.HS.updateListInputs(Bt),Bt={...Lt,...Bt};const Tt=[{result:await e.HS.executeBasedOnTypeAsync(Bt,!1,(e=>t.occt.shapes.wire.divideWireByEqualDistanceToPoints(e))),transformers:[]}],wt={list:[void 0],index:[3],clone:[!0]};let At={};At.list=It,e.HS.updateListInputs(At),At={...wt,...At};const Et=[{result:e.HS.executeBasedOnType(At,!1,(e=>t.lists.removeItemAtIndex(e))),transformers:[]}],gt={list:[void 0],pattern:[[!0,!0,!1]]};let bt={};bt.list=Tt,bt.pattern=p,e.HS.updateListInputs(bt),bt={...gt,...bt};const Wt=[{result:e.HS.executeBasedOnType(bt,!1,(e=>t.lists.getByPattern(e))),transformers:[]}],zt={list:[void 0],clone:[!0]};let Pt={};Pt.list=Et,e.HS.updateListInputs(Pt),Pt={...zt,...Pt};const Xt=e.HS.executeBasedOnType(Pt,!1,(e=>t.lists.reverse(e))),Yt=[];for(let e=0;e<1;e++)Yt.push({type:\\"flat\\"});const Zt=[{result:Xt,transformers:Yt}];let Nt={};Nt.listElements=[Wt[0],ot[0]],e.HS.updateListInputs(Nt),Nt={...Nt};const Ct=[{result:[Nt.listElements?Nt.listElements:[]]}];let kt={};kt.listElements=[Ht[0],Zt[0]],e.HS.updateListInputs(kt),kt={...kt};const Dt=[{result:[kt.listElements?kt.listElements:[]]}],Ft={list:[void 0],clone:[!0]};let Mt={};Mt.list=Ct,e.HS.updateListInputs(Mt),Mt={...Ft,...Mt};const Rt=e.HS.executeBasedOnType(Mt,!1,(e=>t.lists.flipLists(e))),jt=[];for(let e=0;e<2;e++)jt.push({type:\\"flat\\"});const qt=[{result:Rt,transformers:jt}],Vt={points:[void 0]};let Gt={};Gt.points=Dt,e.HS.updateListInputs(Gt),Gt={...Vt,...Gt};const Jt=[{result:await e.HS.executeBasedOnTypeAsync(Gt,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}];let Kt={};Kt.listElements=qt,e.HS.updateListInputs(Kt),Kt={...Kt};const Qt=[{result:[Kt.listElements?Kt.listElements:[]]}],Ut={shape:[void 0],radius:[.3],radiusList:[void 0],indexes:[void 0]};let $t={};$t.shape=Jt,e.HS.updateListInputs($t),$t={...Ut,...$t};const _t=[{result:await e.HS.executeBasedOnTypeAsync($t,!1,(e=>t.occt.fillets.fillet2d(e))),transformers:[]}],es={points:[void 0]};let ts={};ts.points=Qt,e.HS.updateListInputs(ts),ts={...es,...ts};const ss=[{result:await e.HS.executeBasedOnTypeAsync(ts,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}],ns={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let rs={};rs.shape=_t,rs.direction=x,e.HS.updateListInputs(rs),rs={...ns,...rs};const as=[{result:await e.HS.executeBasedOnTypeAsync(rs,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}],os={shape:[void 0]};let is={};is.shape=_t,e.HS.updateListInputs(is),is={...os,...is};const ps=[{result:await e.HS.executeBasedOnTypeAsync(is,!1,(e=>t.occt.shapes.wire.startPointOnWire(e))),transformers:[]}],cs={shape:[void 0]};let us={};us.shape=_t,e.HS.updateListInputs(us),us={...cs,...us};const ls=[{result:await e.HS.executeBasedOnTypeAsync(us,!1,(e=>t.occt.shapes.wire.endPointOnWire(e))),transformers:[]}],ds={shape:[void 0]};let ms={};ms.shape=_t,e.HS.updateListInputs(ms),ms={...ds,...ms};const ys=[{result:await e.HS.executeBasedOnTypeAsync(ms,!1,(e=>t.occt.shapes.wire.closeOpenWire(e))),transformers:[]}],Ss={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let Hs={};Hs.shape=ys,Hs.direction=x,e.HS.updateListInputs(Hs),Hs={...Ss,...Hs};const fs=[{result:await e.HS.executeBasedOnTypeAsync(Hs,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}],hs={shape:[void 0],radius:[1],radiusList:[void 0],indexes:[void 0],direction:[[0,1,0]]};let xs={};xs.shape=ss,xs.direction=A,e.HS.updateListInputs(xs),xs={...hs,...xs};const vs=[{result:await e.HS.executeBasedOnTypeAsync(xs,!1,(e=>t.occt.fillets.fillet3DWire(e))),transformers:[]}],Os={shape:[void 0],face:[void 0],distance:[-.2],tolerance:[.1]};let Is={};Is.shape=as,e.HS.updateListInputs(Is),Is={...Os,...Is};const Ls=[{result:await e.HS.executeBasedOnTypeAsync(Is,!1,(e=>t.occt.operations.offset(e))),transformers:[]}],Bs={shape:[void 0],index:[0]};let Ts={};Ts.shape=as,e.HS.updateListInputs(Ts),Ts={...Bs,...Ts};const ws=[{result:await e.HS.executeBasedOnTypeAsync(Ts,!1,(e=>t.occt.shapes.wire.getWire(e))),transformers:[]}];let As={};As.item=ps,e.HS.updateListInputs(As),As={...As};const Es=[{result:As.item}];let gs={};gs.item=ls,e.HS.updateListInputs(gs),gs={...gs};const bs=[{result:gs.item}];let Ws={};Ws.start=ls,Ws.end=ps,e.HS.updateListInputs(Ws),Ws={start:[[0,0,0]],end:[[0,1,0]],...Ws};const zs=[{result:await e.HS.executeBasedOnTypeAsync(Ws,!1,(e=>t.occt.shapes.wire.createLineWire(e))),transformers:[]}],Ps={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let Xs={};Xs.shape=vs,Xs.angle=et,Xs.direction=o,e.HS.updateListInputs(Xs),Xs={...Ps,...Xs};const Ys=[{result:await e.HS.executeBasedOnTypeAsync(Xs,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}],Zs={shape:[void 0]};let Ns={};Ns.shape=fs,e.HS.updateListInputs(Ns),Ns={...Zs,...Ns};const Cs=[{result:await e.HS.executeBasedOnTypeAsync(Ns,!1,(e=>t.occt.shapes.solid.fromClosedShell(e))),transformers:[]}],ks={shape:[void 0],index:[1]};let Ds={};Ds.shape=ws,e.HS.updateListInputs(Ds),Ds={...ks,...Ds};const Fs=[{result:await e.HS.executeBasedOnTypeAsync(Ds,!1,(e=>t.occt.shapes.edge.getEdge(e))),transformers:[]}],Ms={shape:[void 0],index:[0]};let Rs={};Rs.shape=Ls,e.HS.updateListInputs(Rs),Rs={...Ms,...Rs};const js=[{result:await e.HS.executeBasedOnTypeAsync(Rs,!1,(e=>t.occt.shapes.wire.getWire(e))),transformers:[]}],qs={shape:[void 0],translation:[[0,0,0]]};let Vs={};Vs.shape=zs,Vs.translation=g,e.HS.updateListInputs(Vs),Vs={...qs,...Vs};const Gs=[{result:await e.HS.executeBasedOnTypeAsync(Vs,!1,(e=>t.occt.transforms.translate(e))),transformers:[]}],Js={shape:[void 0],direction:[[0,1,0]]};let Ks={};Ks.shape=Ys,Ks.direction=Ee,e.HS.updateListInputs(Ks),Ks={...Js,...Ks};const Qs=[{result:await e.HS.executeBasedOnTypeAsync(Ks,!1,(e=>t.occt.operations.extrude(e))),transformers:[]}];let Us={};Us.listElements=Cs,e.HS.updateListInputs(Us),Us={...Us};const $s=[{result:[Us.listElements?Us.listElements:[]]}],_s={shape:[void 0],index:[1]};let en={};en.shape=js,e.HS.updateListInputs(en),en={..._s,...en};const tn=[{result:await e.HS.executeBasedOnTypeAsync(en,!1,(e=>t.occt.shapes.edge.getEdge(e))),transformers:[]}];let sn={};sn.listElements=Fs,e.HS.updateListInputs(sn),sn={...sn};const nn=[{result:[sn.listElements?sn.listElements:[]]}],rn={shape:[void 0]};let an={};an.shape=Gs,e.HS.updateListInputs(an),an={...rn,...an};const on=[{result:await e.HS.executeBasedOnTypeAsync(an,!1,(e=>t.occt.shapes.wire.startPointOnWire(e))),transformers:[]}],pn={shape:[void 0]};let cn={};cn.shape=Gs,e.HS.updateListInputs(cn),cn={...pn,...cn};const un=[{result:await e.HS.executeBasedOnTypeAsync(cn,!1,(e=>t.occt.shapes.wire.endPointOnWire(e))),transformers:[]}],ln={shapes:[void 0]};let dn={};dn.shapes=nn,e.HS.updateListInputs(dn),dn={...ln,...dn};const mn=[{result:await e.HS.executeBasedOnTypeAsync(dn,!1,(e=>t.occt.shapes.wire.combineEdgesAndWiresIntoAWire(e))),transformers:[]}];let yn={};yn.listElements=tn,e.HS.updateListInputs(yn),yn={...yn};const Sn=[{result:[yn.listElements?yn.listElements:[]]}],Hn={shape:[void 0],shapes:[void 0],keepEdges:[!1]};let fn={};fn.shape=Qs,fn.shapes=Ye,e.HS.updateListInputs(fn),fn={...Hn,...fn};const hn=[{result:await e.HS.executeBasedOnTypeAsync(fn,!1,(e=>t.occt.booleans.difference(e))),transformers:[]}];let xn={};xn.item=un,e.HS.updateListInputs(xn),xn={...xn};const vn=[{result:xn.item}];let On={};On.item=on,e.HS.updateListInputs(On),On={...On};const In=[{result:On.item}],Ln={shape:[void 0],shapes:[void 0],keepEdges:[!1]};let Bn={};Bn.shape=hn,Bn.shapes=$s,e.HS.updateListInputs(Bn),Bn={...Ln,...Bn};const Tn=[{result:await e.HS.executeBasedOnTypeAsync(Bn,!1,(e=>t.occt.booleans.difference(e))),transformers:[]}],wn={shapes:[void 0]};let An={};An.shapes=Sn,e.HS.updateListInputs(An),An={...wn,...An};const En=[{result:await e.HS.executeBasedOnTypeAsync(An,!1,(e=>t.occt.shapes.wire.combineEdgesAndWiresIntoAWire(e))),transformers:[]}];let gn={};gn.listElements=[Es[0],vn[0],In[0],bs[0]],e.HS.updateListInputs(gn),gn={...gn};const bn=[{result:[gn.listElements?gn.listElements:[]]}],Wn={shape:[void 0],origin:[[0,0,0]],normal:[[0,0,1]]};let zn={};zn.shape=Tn,zn.normal=m,e.HS.updateListInputs(zn),zn={...Wn,...zn};const Pn=[{result:await e.HS.executeBasedOnTypeAsync(zn,!1,(e=>t.occt.transforms.mirrorAlongNormal(e))),transformers:[]}];let Xn={};Xn.listElements=[mn[0],En[0]],e.HS.updateListInputs(Xn),Xn={...Xn};const Yn=[{result:[Xn.listElements?Xn.listElements:[]]}],Zn={points:[void 0]};let Nn={};Nn.points=bn,e.HS.updateListInputs(Nn),Nn={...Zn,...Nn};const Cn=[{result:await e.HS.executeBasedOnTypeAsync(Nn,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}];let kn={};kn.listElements=[Pn[0],Tn[0]],e.HS.updateListInputs(kn),kn={...kn};const Dn=[{result:[kn.listElements?kn.listElements:[]]}],Fn={shapes:[void 0],makeSolid:[!1]};let Mn={};Mn.shapes=Yn,e.HS.updateListInputs(Mn),Mn={...Fn,...Mn};const Rn=[{result:await e.HS.executeBasedOnTypeAsync(Mn,!1,(e=>t.occt.operations.loft(e))),transformers:[]}],jn={shape:[void 0],radius:[.5],radiusList:[void 0],indexes:[void 0]};let qn={};qn.shape=Cn,e.HS.updateListInputs(qn),qn={...jn,...qn};const Vn=[{result:await e.HS.executeBasedOnTypeAsync(qn,!1,(e=>t.occt.fillets.fillet2d(e))),transformers:[]}],Gn={shapes:[void 0]};let Jn={};Jn.shapes=Dn,e.HS.updateListInputs(Jn),Jn={...Gn,...Jn};const Kn=[{result:await e.HS.executeBasedOnTypeAsync(Jn,!1,(e=>t.occt.shapes.compound.makeCompound(e))),transformers:[]}],Qn={shape:[void 0],origin:[[0,0,0]],direction:[[0,0,1]]};let Un={};Un.shape=Rn,Un.origin=we,Un.direction=f,e.HS.updateListInputs(Un),Un={...Qn,...Un};const $n=[{result:await e.HS.executeBasedOnTypeAsync(Un,!1,(e=>t.occt.transforms.mirror(e))),transformers:[]}],_n={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let er={};er.shape=Vn,er.direction=x,e.HS.updateListInputs(er),er={..._n,...er};const tr=[{result:await e.HS.executeBasedOnTypeAsync(er,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}];let sr={};sr.listElements=[as[0],Ls[0],Rn[0],$n[0]],e.HS.updateListInputs(sr),sr={...sr};const nr=[{result:[sr.listElements?sr.listElements:[]]}],rr={shape:[void 0],offset:[-.1]};let ar={};ar.shape=tr,e.HS.updateListInputs(ar),ar={...rr,...ar};const or=[{result:await e.HS.executeBasedOnTypeAsync(ar,!1,(e=>t.occt.operations.makeThickSolidSimple(e))),transformers:[]}],ir={shape:[void 0],angle:[0],center:[[0,0,0]],axis:[[0,0,1]]};let pr={};pr.shape=Kn,pr.angle=Ve,pr.axis=N,e.HS.updateListInputs(pr),pr={...ir,...pr};const cr=[{result:await e.HS.executeBasedOnTypeAsync(pr,!1,(e=>t.occt.transforms.rotateAroundCenter(e))),transformers:[]}],ur={shapes:[void 0],tolerance:[1e-7]};let lr={};lr.shapes=nr,e.HS.updateListInputs(lr),lr={...ur,...lr};const dr=[{result:await e.HS.executeBasedOnTypeAsync(lr,!1,(e=>t.occt.shapes.shell.sewFaces(e))),transformers:[]}],mr={entity:[void 0],options:[void 0],babylonMesh:[void 0]};let yr={};yr.entity=or,yr.options=W,e.HS.updateListInputs(yr),yr={...mr,...yr};await e.HS.executeBasedOnTypeAsync(yr,!1,(e=>t.draw.drawAnyAsync(e)));let Sr={};Sr.listElements=cr,e.HS.updateListInputs(Sr),Sr={...Sr};const Hr=[{result:[Sr.listElements?Sr.listElements:[]]}],fr={shapes:[void 0]};let hr={};hr.shapes=Hr,e.HS.updateListInputs(hr),hr={...fr,...hr};const xr=[{result:await e.HS.executeBasedOnTypeAsync(hr,!1,(e=>t.occt.shapes.compound.makeCompound(e))),transformers:[]}];let vr={};vr.listElements=[dr[0],ye[0],xr[0]],e.HS.updateListInputs(vr),vr={...vr};const Or=[{result:[vr.listElements?vr.listElements:[]]}],Ir={shapes:[void 0]};let Lr={};Lr.shapes=Or,e.HS.updateListInputs(Lr),Lr={...Ir,...Lr};const Br=[{result:await e.HS.executeBasedOnTypeAsync(Lr,!1,(e=>t.occt.shapes.compound.makeCompound(e))),transformers:[]}],Tr={entity:[void 0],options:[void 0],babylonMesh:[void 0]};let wr={};wr.entity=Br,e.HS.updateListInputs(wr),wr={...Tr,...wr};await e.HS.executeBasedOnTypeAsync(wr,!1,(e=>t.draw.drawAnyAsync(e)))}(BitByBit,bitbybit,bitbybitRunnerResult,bitbybitRunnerInputs,Bit);\"}' };