Skip to content

Commit

Permalink
reformated
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTesla committed Aug 1, 2024
1 parent a0cf551 commit f6c0d9c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
6 changes: 4 additions & 2 deletions demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
#######################################################################


from numba import jit, njit
import math
from xyzcad import render
import time

from numba import jit, njit

from xyzcad import render


@jit(nopython=True, cache=True)
def f(x, y, z):
Expand Down
6 changes: 4 additions & 2 deletions demo2.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
#######################################################################


from numba import jit, njit
import math
from xyzcad import render
import time

from numba import jit, njit

from xyzcad import render


@njit
def sphere(x, y, z):
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ isort = "^5.13.2"
pytest = "^8.3.2"
admesh = "^0.98.9"

[tool.isort]
line_length = 79

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
11 changes: 5 additions & 6 deletions tests/test_render.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import pytest
import admesh
import pytest
from numba import njit

from xyzcad import render


@njit
def sphere(x, y, z):
return 20**2 > x**2 + y**2 + z**2


def test_render_sphere():
render.renderAndSave(sphere, "build/sphere.stl", 0.5)
stl = admesh.Stl('build/sphere.stl')
stl = admesh.Stl("build/sphere.stl")
assert stl.stats["max"]["x"] > 19
assert stl.stats["max"]["x"] < 21
assert stl.stats["min"]["x"] < -19
Expand All @@ -22,7 +25,3 @@ def test_render_sphere():
assert stl.stats["max"]["z"] < 21
assert stl.stats["min"]["z"] < -19
assert stl.stats["min"]["z"] > -21




6 changes: 3 additions & 3 deletions xyzcad/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
#######################################################################


import numpy as np
import time
from numba import njit, objmode, prange, types
from numba.typed import List, Dict

import numpy as np
from numba import njit, objmode, prange, types
from numba.typed import Dict, List
from stl import mesh

tlt = [[[0]]] * 256
Expand Down

0 comments on commit f6c0d9c

Please sign in to comment.