Repository navigation
smlibpy 0.2.2
STEP files from NX and from tool catalogs import right, and smlibpy comes to JavaScript.
New
smlibwasm. smlibpy for JavaScript and TypeScript: the same API on the same kernel, compiled to WebAssembly. It runs in the browser and in Node, has no dependencies, and loads about 1.8 MB over the wire (brotli). It is on npm as @classcad/smlibwasm (npm install @classcad/smlibwasm); the package and its WebAssembly module are attached to this release. See smlibpy in JavaScript.
import { Box, Cylinder, GridLocations, Z, toStep } from '@classcad/smlibwasm'
let plate = Box(80, 60, 10)
plate = plate.fillet(plate.edges().parallelTo(Z), 8)
plate = plate.cut(GridLocations(60, 40, 2, 2).mul(Cylinder(4, 10)))
const step = toStep(plate)read_step(path) returns a StepModel: the bodies, and the coordinate systems, curves and points of the file that belong to no body, with their names and products, at their place in the assembly. render() and the live viewer draw them.
Fixed
- STEP files from NX: extrusions of ellipses (small roundings) no longer raise, and faces of cylinders, cones, spheres, tori, revolutions and extrusions that NX writes without their seam get it from the kernel. A drill that came out with three different volumes is valid now.
- STEP files from tool catalogs (58 files that other importers failed on): faces that lie across the seam of a closed B-spline surface, faces whose orientation flag contradicts their loops, loops with a slit cut into the face, and solids with cavities (built as void regions, as the file has them). All 58 import as valid solids, with the faces OpenCASCADE reads and volumes within 0.04 % of its.
- A surface model whose faces lack their seam no longer fails to import.
- The live viewer meshes each body once and cuts the mesh by face, so a face the kernel cannot copy out of its body no longer drops the whole body.
Face.to_shell()andstitch()work on such faces too. - Kernel patch: an offset whose faces collapse (
thicken,shell) read faces and edges it had already removed, which could crash. - DXF: spline fit-point tangents kept only their x; a file that starts with a UTF-8 byte order mark is read.