Skip to content

Commit

Permalink
Check with Sphinx 7.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
portnov committed Jul 15, 2024
1 parent e117b2b commit b298d51
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs_builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Sphinx
run: pip install -U Sphinx
run: pip install -U Sphinx==7.3.7

- name: Install Theme
run: pip install sphinx-rtd-theme
Expand Down
29 changes: 12 additions & 17 deletions node_scripts/SNLite_templates/demo/voronoi_scipy_3d.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
"""
in in_points v
in in_faces s
out out_verts v
out out_faces s
"""
import logging

logger = logging.getLogger('sverchok')

try:
import scipy
from scipy.spatial import Voronoi
except ImportError as e:
logger.info("SciPy module is not available. Please refer to https://github.com/nortikin/sverchok/wiki/Non-standard-Python-modules-installation for how to install it.")
raise e
import numpy as np
from sverchok.data_structure import zip_long_repeat

out_verts = []
out_edges = []
out_faces = []

for points in in_points:
vor = Voronoi(points)
for verts, faces in zip_long_repeat(in_points, in_faces):
verts = np.array(verts)
faces = np.array(faces)
tris = verts[faces]
v1s = tris[:,1] - tris[:,0]
v2s = tris[:,2] - tris[:,1]
normals = np.cross(v1s, v2s)

new_verts = vor.vertices.tolist()
new_faces = [e for e in vor.ridge_vertices if not -1 in e]
out_verts.append(normals.tolist())


out_verts.append(new_verts)
out_faces.append(new_faces)

4 changes: 4 additions & 0 deletions utils/curve/nurbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ def reduce_degree(self, delta=None, target=None, tolerance=1e-6, return_error=Fa

def reduce_degree_once(curve, tolerance):
if curve.is_bezier():
logger.info(f"bz: degree => {curve.get_degree()}")
old_control_points = curve.get_homogenous_control_points()
control_points, error = reduce_bezier_degree(curve.get_degree(), old_control_points, 1)
if tolerance is not None and error > tolerance:
Expand All @@ -385,11 +386,14 @@ def reduce_degree_once(curve, tolerance):
else:
src_t_min, src_t_max = curve.get_u_bounds()
segments = curve.to_bezier_segments(to_bezier_class=False)
logger.info(f"not bz: degree => {curve.get_degree()}; segments: {len(segments)}")
reduced_segments = []
max_error = 0.0
for i, segment in enumerate(segments):
try:
logger.info(f"=> #{i} c {segment}")
s, error, ok = reduce_degree_once(segment, tolerance)
logger.info(f"=> degree = {s.get_degree()}")
logger.debug(f"Curve segment #{i}: error = {error}")
except CantReduceDegreeException as e:
raise CantReduceDegreeException(f"At segment #{i}: {e}") from e
Expand Down
2 changes: 1 addition & 1 deletion utils/curve/primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def _arc_to_nurbs(self, t_min, t_max, implementation = SvNurbsMaths.NATIVE):
control_points, weights)

if alpha > 2*pi/3:
nurbs = nurbs.insert_knot(t_mid)
nurbs = nurbs.insert_knot(t_mid,2)

return nurbs

Expand Down
4 changes: 2 additions & 2 deletions utils/surface/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,7 @@ def nurbs_revolution_surface(curve, origin, axis, v_min=0, v_max=2*pi, global_or

any_circle = SvCircle(Matrix(), 1)
any_circle.u_bounds = (v_min, v_max)
any_circle = any_circle.to_nurbs()
any_circle = any_circle.to_nurbs_full()
# all circles with given (v_min, v_max)
# actually always have the same knotvector
# and the same number of control points
Expand All @@ -1217,7 +1217,7 @@ def nurbs_revolution_surface(curve, origin, axis, v_min=0, v_max=2*pi, global_or
else:
circle = SvCircle.from_equation(eq)
circle.u_bounds = (v_min, v_max)
nurbs_circle = circle.to_nurbs()
nurbs_circle = circle.to_nurbs_full()
parallel_points = nurbs_circle.get_control_points()
parallel_weights = circle_weights * my_weight
control_points.append(parallel_points)
Expand Down

0 comments on commit b298d51

Please sign in to comment.