Add example projects covering all OpenCAD API surfaces#2
Draft
Add example projects covering all OpenCAD API surfaces#2
Conversation
Co-authored-by: deanhu0822 <86739329+deanhu0822@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add example projects for OpenCAD APIs
Add example projects covering all OpenCAD API surfaces
Mar 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Users had no runnable reference material to learn from or use as a starting point for building on top of OpenCAD's APIs. Adds an
examples/directory with six self-contained projects spanning every major API layer.Examples
01_hello_part/— headless fluent API: box + cylinder + boolean cut + fillet + STEP export02_parametric_bracket/— parameterised sketch → extrude → linear pattern → fillet; tunable constants at the top of the file03_rest_api_client/— kernel REST API via stdliburllib: health checks, list ops, create shapes, mesh fetch, topology, replay04_sketch_solver/— solver REST API:solve,check, anddiagnose(DOF, Jacobian sparsity, over/under-constrained variables)05_feature_tree/— tree REST API: CRUD, rebuild with stale propagation, suppression, branching, and serialize/deserialize round-trip06_agent_chat/— agent REST API: natural-language design prompts, multi-turn conversation,reasoningmodeEach example has a
README.mddescribing prerequisites and expected output. Examples 01–02 run in-process with no services; 03–06 require the relevant backend services.Tests
examples/tests/test_examples.pyprovides 7 pytest tests that import and execute the headless examples end-to-end, asserting on tree node count, operation set, node statuses, and that design parameters (pattern count, fillet radius) round-trip correctly.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.