Skip to main content

Software renders implicit surface function f(x,y,z) into aprintable STL.

Project description

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 jit
from xyzcad import render

@jit(nopython=True)
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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xyzcad-0.4.0.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

xyzcad-0.4.0-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file xyzcad-0.4.0.tar.gz.

File metadata

  • Download URL: xyzcad-0.4.0.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.6

File hashes

Hashes for xyzcad-0.4.0.tar.gz
Algorithm Hash digest
SHA256 b65dc042edf8d0869b3e13d39a0a7206e111c5251cc5ca8efa49f9e10ce308ec
MD5 461a1547f5941ae776e7833343aaa1e6
BLAKE2b-256 d800ed7279da20f9318f666323e7efbfe5f1a7870279b20965ae59711f0ff6cf

See more details on using hashes here.

File details

Details for the file xyzcad-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: xyzcad-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.6

File hashes

Hashes for xyzcad-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 329d5238b60c6b11a67844c1a02fdbc8907223aa406515535484bfa85e1d462c
MD5 9fd838118283345d126a0fd695f29152
BLAKE2b-256 7c791649c5004fa890304faf9e5f93e300be58dbaee31ea492b86c5079182f08

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page