Skip to main content

Update - 30th June 2024

  • some optimizations to speed up

Update - 22nd June 2024

  • Triangle Lookup Table implemented - no defective surfaces anymore

  • nearly all functions compiled with Numba - faster operation

Update - 27th November 2022

A new, much faster version is available. It uses more numba jit compiled python code and more parallelization.

The first run may be slower due to compilation time.

example image

xyzCad - functional cad software

xyzCad is an ease to use marching cubes based cad software generating 3d printable stl files from a function f(x, y, z) = {True : False}.

x, y and z are the coordinates in 3d space in mm. The function f(x, y, z) returns True or False depending on the arguments x, y and z. True means, there should be solid. False means, there is nothing.

Theory of operation

It looks like the software iterates over alle points in the 3d raster space. But this would be very slow. So the algorithm is a bit more optimized.

  1. At first it searches for two points, one inside the solid (=True), one outside (=False).

  2. Now the surface is searched on a line between the two points.

  3. Rasterization is done over the surface only.

That means only one solid can be created. If two solids without contact to each other are created, only the one found at first will be rendered.

Usage example

Let us create a sphere:

#!/usr/bin/env python3

from numba import njit
from xyzcad import render

@njit
def f(x,y,z):
    r = 10
    return r**2 > x**2 + y**2 + z**2

render.renderAndSave(f, 'sphere.stl', 0.3)

numba just in time compiler makes it a bit faster. render is the xyzcad renderer/compiler. We want a resolution of 0.3 mm. The output file should be sphere.stl. Our sphere will have a radius of r = 10 mm.

Want to Support the project?

Buy your 3d printer filament or parts using my affiliate link:

Amazon

eBay

Release files for xyzcad 0.7.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xyzcad 0.7.3
File Size Uploaded
xyzcad-0.7.3.tar.gz 20.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xyzcad 0.7.3
File Interpreter ABI Platform
xyzcad-0.7.3-py3-none-any.whl Python 3 none any Details

Total release size: 41.9 kB

Release files / xyzcad-0.7.3.tar.gz

Download URL xyzcad-0.7.3.tar.gz
Size 20.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d7311d861171846364bb6b070e8db0e1222bf487620ee5f9c07e3ac9a1a27cd5
BLAKE2b-256 checksum
How to use checksums
a1ce2356313e4ca7e6ca047c5c70fb2a5421ac6f43256f5b73f4566e6e8aa84c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.2 CPython/3.11.14 Linux/6.11.0-1018-azure

Release files / xyzcad-0.7.3-py3-none-any.whl

Download URL xyzcad-0.7.3-py3-none-any.whl
Size 21.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7617095d988761977c66d3a19740a509cb407b74ddd79a1e470d6615a4e703d2
BLAKE2b-256 checksum
How to use checksums
397c0e5886ce3131eb1e87c4c580cc3252d8381b9e42302a0fdd056593eb1a6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.2 CPython/3.11.14 Linux/6.11.0-1018-azure
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page