๐Ÿงฉ Full Code Mechanical Design

A code-driven approach to mechanical design without relying on GUI-based CAD workflows.

Back to Portal (EN)

This repository explores a methodology for designing mechanical parts and assemblies
entirely through Python code using FreeCAD, focusing on:


Language GitHub Pages ๐ŸŒ GitHub ๐Ÿ’ป
๐Ÿ‡บ๐Ÿ‡ธ English GitHub Pages EN GitHub Repo EN

This repository explores a methodology for designing mechanical parts and assemblies
entirely through Python code using FreeCAD, focusing on reproducibility,
clarity of design intent, and automation.

๐Ÿ“Œ Persistent Identifier (DOI)
DOI


๐Ÿ“š Citation & Prior Art

This work is published with a DOI via Zenodo (10.5281/zenodo.18134920)
and constitutes prior art for code-driven mechanical design methodologies.


๐Ÿ•ฐ Historical Context

Prototype fabrication โ†’ machining โ†’ dimensional measurement โ†’ drawing.
Three-dimensional objects are projected onto two-dimensional drawings
using orthographic projection, and conversely, three-dimensional form
is reconstructed mentally from two-dimensional drawings.

This bidirectional translation constituted a core skill
for traditional mechanical designers.

From this perspective, it is understandable that
generative design or code-driven approachesโ€”where the designer
does not directly manipulate geometryโ€”can feel intuitively
difficult to accept.

However, semiconductor layout design followed a similar trajectory.

There was a time when routing was performed manually,
with designers carefully accounting for process-specific behavior
based on experience and tacit knowledge.

As design rules were formalized and incorporated into PDKs,
the center of design activity shifted
from manual layout to logical description using Verilog.

Viewed in the context of technological history,
it may be unavoidable that mechanical design
will follow a comparable path.


๐Ÿ† Why Full Code Mechanical Design Wins

Mechanical design should not be treated as a static artifact
(CAD data or drawings),
but as a reproducible, evolvable set of rules.

Full Code Mechanical Design shifts the core of mechanical design from
manual GUI operations to explicit, executable code.

In this approach:

This is not an efficiency improvement.
It is a structural transformation of mechanical design itself.

Once design logic is expressed as code,
there is no reason to return to GUI-driven workflows.


๐Ÿง  Concept

Traditional CAD workflows are heavily dependent on GUI operations,
feature histories, and constraint-based assemblies.

This project intentionally avoids those assumptions and adopts the following principles:

The goal is to preserve design intent and reproducibility directly in code.


โ“ Why Code-Driven Mechanical Design?

This approach can be summarized as:

Mechanical Design as Code


๐Ÿ“ Design Policy


๐Ÿ—‚ Repository Structure

โ”œโ”€ src/
โ”‚  โ”œโ”€ parts/        # Individual part generators (functions/modules)
โ”‚  โ”œโ”€ assembly/     # Assembly and layout definitions
โ”‚  โ””โ”€ build.py      # Entry point to generate the complete model
โ”œโ”€ README.md
โ””โ”€ LICENSE

โ–ถ Quick Start (Minimal Reproducible Example)

This repository includes a minimal working example that generates
a simple 3D mechanical model using FreeCAD in headless (non-GUI) mode.

๐Ÿ”ง Requirements

โš ๏ธ Important
Do NOT use system Python.
You must use the Python interpreter bundled with FreeCAD.


โ–ถ Execution (Windows example)

cd src
"C:\Program Files\FreeCAD 0.21\bin\FreeCADCmd.exe" build.py

This will:

The FreeCAD GUI is not required for model generation.
It may be used only to inspect the generated result.


โ–ถ Execution (Linux example)

cd src
freecadcmd build.py

๐ŸŽฏ Purpose of This Example

This example is intentionally minimal.

Its purpose is not to demonstrate complex geometry,
but to prove that:


๐Ÿšง Status

This repository currently focuses on defining the
conceptual and architectural principles
of Full Code Mechanical Design.

Python / FreeCAD implementation examples
will be added incrementally.


๐Ÿงญ Philosophy

CAD is not a drawing tool.
It is an engine for executing design logic.


๐Ÿงฑ Example Output

The following model was generated by running the provided Python code in FreeCAD
without any GUI-based modeling operations.

Code-generated mechanical assembly (FreeCAD + Python)

Figure 1. Mechanical assembly generated purely by Python code using FreeCAD as a geometry engine.


๐Ÿ“ Geometric Core Example (Function-Defined Geometry)

The following model demonstrates a purely geometric solid
generated from a continuous mathematical function,
without sketches, constraints, or GUI-based modeling steps.

Function-defined geometric solid generated purely by code

Figure 2. A geometric solid generated from an explicit radius function
$r = f(z)$ using Python code and FreeCAD as a geometry engine.


๐Ÿ”Œ Analogy to SoC Design

This approach is directly analogous to modern SoC design workflows.

In this sense:

Full Code Mechanical Design is to mechanical engineering
what RTL is to SoC design.


๐Ÿ’Ž Beyond CAD: Mechanical Design as IP

By expressing geometry, constraints, and design decisions
entirely in code, mechanical design itself becomes
a reusable and evolvable intellectual property (IP).

The generated CAD model is only a byproduct.
The true asset is the executable design knowledge.


๐Ÿ” Practical Workflow Comparison

Conventional Mechanical Design vs Full Code Mechanical Design

Aspect Conventional Workflow Full Code Mechanical Design
Design authoring GUI-based CAD operations Python code
Dimensions Fixed Variables
Design intent Implicit Explicit
Design change Manual edits Logic change
Reusability Low High
Review Drawings Code + model
Scalability Limited High

๐Ÿ‘ค Author

๐Ÿ“Œ Item Details
Name Shinichi Samizo
Expertise Semiconductor devices (logic, memory, high-voltage mixed-signal)
Thin-film piezo actuators for inkjet systems
PrecisionCore printhead productization, BOM management, ISO training
GitHub GitHub

๐Ÿ“„ License

Hybrid License

Item License Description
Source Code Apache License 2.0 Free to use, modify, redistribute, with patent protection
Text Materials CC BY 4.0 Attribution required
Figures & Diagrams CC BY-NC 4.0 Non-commercial use only
Generated CAD Outputs Same as source code Derived from licensed code
External References Original license applies Cite properly

Methodology Notice

This repository discloses a code-driven mechanical design methodology. The methodology itself is provided as prior art and may not be claimed as exclusive intellectual property by third parties.

Prior Art Notice

This repository and its associated Zenodo record (DOI: 10.5281/zenodo.18134920) constitute a public disclosure of the Full Code Mechanical Design methodology.


๐Ÿ’ฌใ€€Feedback

Suggestions, improvements, and discussions are welcome via GitHub Discussions.

๐Ÿ’ฌ GitHub Discussions