Skip to content

‹Addon› LegoFace #128

Description

@jacquesh82

🔌 𝗥𝗲𝗽𝗼𝘀𝗶𝘁𝗼𝗿𝘆

https://github.com/jacquesh82/FreeCAD-LegoFace

📑 𝗡𝗼𝘁𝗲𝘀

LegoFace adds a "Transform to LEGO face" entry to the Part Design Face Tools task panel (shown when a planar face is selected). It generates LEGO-compatible studs (male) or sockets (female) on the face as native Part Design features (a Sketch attached to the face + Pad/Pocket), so documents stay fully editable and open without the addon installed.

Features: auto-computed adjustable N×M grid at the 8 mm LEGO pitch, layouts (full face / spread with 3 densities / border / sides), and an "FDM printing" checkbox adding clearance on the female side. English UI with a French translation following FreeCAD's language preference.

Technical points for the review:

  • Modern namespaced layout (freecad/LegoFace/), no sys.path manipulation, no Python dependencies, FreeCAD ≥ 1.0 (tested on 1.1.3). Manifest declares the <other> content type since the addon provides no workbench.
  • Transparency on one point: the addon's purpose is to extend the Part Design Face Tools task panel. Since Gui.Control.addTaskWatcher() replaces the whole watcher list, the addon replicates the stock Part Design watcher list (from PartDesignGui::Workbench::activated()) with its single command inserted, and reinstalls it when the Part Design workbench is activated. The stock panel is preserved identically; the code is isolated in one module (watcher.py) and wrapped in try/except so any failure leaves the standard panel untouched. I'm happy to adapt this approach if the team prefers another integration point.
  • Headless test suite included (FreeCADCmd tests/headless_test.py).

Release: v0.2.0 (tagged). Repository topics freecad and addon are set. Thanks for reviewing!

Metadata

Metadata

Assignees

No one assigned

    Labels

    +Addition of something new.💿 𝗔𝗱𝗱𝗼𝗻In the context of an addon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions