Repository navigation
Releases
Releases · DavidMStraub/solidfunc
v0.1.0a5
Notebook display
- A shape at the end of a notebook cell displays as an interactive 3D view in Jupyter, VS Code, and other notebook frontends, with no extra Python packages. The view uses vtk.js, loaded from a CDN at a pinned version.
- Where scripts can't run (GitHub, nbviewer, untrusted notebooks) or the CDN is unreachable, a static isometric SVG shows instead.
Reprs
Shape,Face,Edge,Vertex,Curve2D,Path2D,Path3D, andProfilehave readable reprs, such as<Shape: 10 faces, 18 edges>,<Face plane, normal (0, 0, 1)>, or<Edge circle r=10, (10, 0, 10) to (10, 0, 10)>. They avoid costly computations such as volume or face centroids.
Try it in the browser
examples/try_solidfunc.ipynbopens in Colab from the badge in the README.
Development
- The dev container installs
ipykerneland the VS Code Jupyter extension.
See the API reference for signatures and conventions.
v0.1.0a4
Selection data
- Faces report
kind("plane","cylinder","cone","sphere","torus","spline","revolution", or"blend") andarea. - Edges report
start,end, and, for line edges,line_direction. FaceKindandEdgeKindareLiteraltypes, so a type checker rejects a misspelled comparison such asface.kind == "cylindre".
Viewing and platforms
show()shades with the kernel's vertex normals, so curved faces render without visible facets.- Python 3.15 is tested in CI and declared in the package metadata.
Documentation
- The README has a gallery of parts from CAD as Code, rebuilt as examples, and describes the project's motivation, findings, and coverage.
CITATION.cffdescribes how to cite solidfunc.
See the API reference for signatures and conventions.
v0.1.0a3
Breaking API changes
polygon()andrectangle()return closedPath2Dboundaries. Fill them withprofile().rectangle()is centred oncenterinstead of starting atorigin.extrude(),revolve(),sweep(), andloft()accept only aProfileand raiseTypeErrorfor curves and paths.box()andcylinder()are centred in XY with their base at z = 0, andoriginis removed. Position them withplace()ortranslate().- Renamed:
loft(interpolation_deg=)toloft(degree=),spline()tospline3d(),Face.centertoFace.centroid, andFace.normaltoFace.planar_normal. a - braisesEmptyResultError, aValueErrorsubclass, when no material remains.difference()still returnsNone.
Modeling
place(shape, plane)carries a shape from world XY onto a plane, andPlane.offset()moves a plane along its own axes, for exampleplace(stud, Plane.from_face(top).offset(x=3)).union()accepts any number of shapes and combines them in one kernel operation.a & bintersects two shapes and raisesEmptyResultErrorwhen they share no material.intersection()still returnsNone.polyline()builds open planar paths.profile()accepts a single closed curve, soprofile(circle(radius=5))fills a disk, and rectangles, polygons, and circles can all be holes.cylinder()andcircle()acceptdiameteras an alternative toradius.bounds()returns aBoundsnamed tuple withmin,max,size, andcenter.
Fixes
- Faces, edges, and vertices from separate queries of one shape compare equal and hash alike, so sets and
inwork.fillet()andchamfer()round a repeated edge once instead of failing.
See the API reference for signatures and conventions.
v0.1.0a2
Breaking API changes
box()usessize_x,size_y, andsize_z.rotate()andrevolve()useaxis_direction,axis_origin, andangle_deg.arc()usesstart_angle_degandsweep_angle_deg.- Use
distancefor extrusion,setbackfor chamfer,interpolation_degfor loft, andrelative_tolerancefor volume.
Modeling and exchange
- Create planar curves and profiles, place them in 3D, and extrude, revolve, loft, or sweep them. Sweeps support hollow sections.
- Inspect faces, edges, and vertices. Apply fillets and equal-distance chamfers to selected edges.
- Import and export STEP. See the API reference for signatures and conventions.
v0.1.0a1
First experimental release: functional SolidCore bindings with box creation, translation, volume, bounds, and STEP export.