Skip to main content

An implicit surface based functional CAD system

Project description

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

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.7.1.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

xyzcad-0.7.1-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xyzcad-0.7.1.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.12 Linux/6.11.0-1014-azure

File hashes

Hashes for xyzcad-0.7.1.tar.gz
Algorithm Hash digest
SHA256 87c08722e77ede74018d297f00b9793f6c0b89324ee34b88b3237c1909372269
MD5 6bb68149795312ba3ecf5d49552e048d
BLAKE2b-256 33459c16e684e5894195980099bef824cef26aaa9dfb0e99984c275f2d076492

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyzcad-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.12 Linux/6.11.0-1014-azure

File hashes

Hashes for xyzcad-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c5e35ef12ed3e70f4dd24569e711f423c058e70095bb3747b68d02e6499dd7e6
MD5 7c2f0029e2d2b84e81a4e3974e751da9
BLAKE2b-256 5ab7f9f1f4c49348e056ebfe4820504736b2e78dccc2684321eb933d0fb2e42f

See more details on using hashes here.

Supported by

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