GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - planex2d/planex2d: exact 2D geometry for Python (in 3D)

BranchesTags
Open more actions menu

Latest commit

 

History

62 Commits
62 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
external_dependencies
external_dependencies
 
 
src
src
 
 
tests
tests
 
 
tools
tools
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CITATION.cff
CITATION.cff
 
 
CMakeLists.txt
CMakeLists.txt
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
THIRD_PARTY_NOTICES.md
THIRD_PARTY_NOTICES.md
 
 
pyproject.toml
pyproject.toml
 
 

Repository files navigation


planex2d

Fast, exact 2D geometry for Python
Documentation · Installation · Examples · CAD practice drawings · Playground · License and notices
DOI 10.5281/zenodo.23718969

planex2d is free software under the GNU Lesser General Public License, version 2.1 or (at your option) any later version. Its compiled module contains code from Eigen, pybind11 and Taskflow; its OpenCASCADE bindings, the package planex2d-occ, are linked to Netgen and Open CASCADE Technology and make use of facilities provided by the Open CASCADE Technology software. See License and notices and THIRD_PARTY_NOTICES.md.

What it is

planex2d is a 2D geometry kernel for Python, written in C++. You draw outlines from lines, arcs, circles and splines, combine them with exact Boolean operations, dimension them with constraints, and clean up drawings imported from other tools. The resulting faces go to OpenCASCADE, netgen/NGSolve, gmsh and other tools for 3D modeling, meshing and simulation.

Installation

pip install planex2d          # the core: sketches, faces, Booleans, drawings, files
pip install "planex2d[occ]"   # with the OpenCASCADE bindings and netgen

The quotes keep shells like zsh, the default on macOS, from reading the brackets as a file pattern.

planex2d comes as wheels for Linux (x86_64 and aarch64), macOS (Apple silicon and Intel, macOS 13.3 or newer) and Windows (x86-64), for Python 3.11 to 3.14; on Windows it needs the latest Microsoft Visual C++ Redistributable (x64), which most machines have. In the browser, Pyodide 0.29 and 314 install the core with micropip.install("planex2d"). The core runs on numpy alone. The extra occ installs planex2d-occ, the OpenCASCADE bindings built for the last netgen releases (on Linux x86_64, macOS and Windows, where netgen has wheels), and netgen with it; planex picks the bindings for the installed netgen. The package is called planex2d on PyPI and planex in Python (import planex as px). See Installation for the optional packages and for building from source (a C++20 compiler, CMake; Xcode 16 on macOS, Visual Studio 2022 on Windows).

A first sketch

A QuickSketch draws with a pen: Line draws along the current direction, Turn changes the direction, Arc continues with a tangent arc, and Close joins the outline to its start. Circle adds a hole. The result is an angle bracket with an inner fillet and two holes.

import planex as px

bracket = px.QuickSketch()
bracket.Line(60).Turn(90).Line(10).Turn(90).Line(40)
bracket.Arc(10, -90).Line(30).Turn(90).Line(10).Close()
bracket.Circle((45, 5), 2.5).Circle((5, 35), 2.5)
face = bracket.Face()
face.Plot()

The angle bracket drawn by the pen: two legs, an inner fillet of radius 10 and a hole in each leg

In the browser

The playground runs planex2d in the browser, with nothing to install: the code on the left, what it prints and draws on the right, and a link that carries the code. Many of the examples open there. The tools on planex2d.org, a viewer, converters, a section calculator, a contour checker and a nesting tool for DXF, SVG and STEP files, run on planex2d in the browser too.

Examples

The examples are complete parts and classic problems, each with its own numbers, and most of them check their result against a formula, a textbook value or a measured property.

A planetary gearbox with its sun, three planets and ring gear The Jansen linkage, the leg of the Strandbeest A motor lamination glued into stator, coils, rotor and magnets Chladni figures, the nodal lines of a vibrating square plate A part sliced into layers with perimeters and infill for 3D printing A Penrose tiling of golden triangles

Where to go next

  • Quick sketches and constraint sketches: drawing, and dimensions and relations that a solver keeps satisfied.
  • Boolean operations, measuring and cleaning up imported drawings.
  • Files: DXF, KiCad, SVG, STEP and more.
  • OpenCASCADE and netgen/NGSolve: from faces to solids, meshes and simulations.
  • Examples: mechanisms, machines, fields and manufacturing.
  • CAD practice drawings: 2D and 3D parts as dimensioned drawings, to model in planex2d or any CAD system.
  • Benchmarks: planex2d next to OpenCASCADE and polygon libraries on the same tasks.

Citing

If you use planex2d in research, please cite it with its Zenodo DOI, 10.5281/zenodo.23718969, which always points to the latest version. CITATION.cff holds the citation data.

License

planex2d is Copyright (C) 2026 Sebastian Hirnschall.

planex2d is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

planex2d is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, the file LICENSE, for more details. The third-party notices are in THIRD_PARTY_NOTICES.md and on the page License and notices.

About

exact 2D geometry for Python (in 3D)

planex2d.org/

Topics

2d-cadboolean-operationscadcomputational-geometryconstraint-solverdxfengineeringfemgeometrygmshkicadmesh-generationnetgenopencascadeoptimizationparameter-studyparametric-designpythonsketchstep

Resources

Readme
LGPL-2.1 license
Activity
Custom properties

Stars

4 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.