Open chenboshuo opened 1 year ago
I don't have a valid ACIS license anymore, so I cannot test it. ZeroDivisionError
may happen, because the algorithms are using the user input directly. There is a frange
implementation, but I doubt that's the problem. There were several other problems like that and converting values like -59.99999999999998579
to -60
worked fine at that point. You could try that.
I was planning to implement a more precise floating point control to eliminate such issues, but never had time to do it without adding any additional dependencies.
I don't have a valid ACIS license anymore, so I cannot test it.
ZeroDivisionError
may happen, because the algorithms are using the user input directly. There is afrange
implementation, but I doubt that's the problem. There were several other problems like that and converting values like-59.99999999999998579
to-60
worked fine at that point. You could try that.I was planning to implement a more precise floating point control to eliminate such issues, but never had time to do it without adding any additional dependencies.
I changed this snippets to
from geomdl import BSpline
# Create a BSpline surface instance (Bezier surface)
surf = BSpline.Surface()
surf.degree_u=2
surf.degree_v=2
surf.ctrlpts_size_u=5
surf.ctrlpts_size_v=9
surf.ctrlpts=[
(52.5, 60, 0),
(52.5, 60, 60),
(52.5, 0, 60),
(52.5, -60, 60.0),
(52.5, -60, 0),
(52.5, -60.0, -60),
(52.5, 0, -60),
(52.5, 60, -60.0),
(52.5, 60, 0),
(17.5, 60, 0),
(17.5, 60, 60),
(17.5, 0, 60),
(17.5, -60, 60),
(17.5, -60, 0),
(17.5, -60, -60),
(17.5, 0, -60),
(17.5, 60, -60),
(17.5, 60, 0),
(17.5, 0, 0),
(17.5, 0, 0),
(17.5, 0, 0),
(17.5, 0, 0),
(17.5, 0, 0),
(17.5, 0, 0),
(17.5, 0, 0),
(17.5, 0, 0),
(17.5, 0, 0),
(0, 0, 0),
(0, 0, 0),
(0, 0, 0),
(0, 0, 0),
(0, 0, 0),
(0, 0, 0),
(0, 0, 0),
(0, 0, 0),
(0, 0, 0),
(0, 0, 0),
(0, 0, 0),
(0, 0, 0),
(0, 0, 0),
(0, 0, 0),
(0, 0, 0),
(0, 0, 0),
(0, 0, 0),
(0, 0, 0),
]
surf.weights=[
1, 0.707107, 1, 0.707107, 1, 0.707107, 1, 0.707107, 1, 0.707107, 0.5, 0.707107, 0.5, 0.707107, 0.5, 0.707107, 0.5, 0.707107, 1, 0.707107, 1, 0.707107, 1, 0.707107, 1, 0.707107, 1, 0, 52.5, 60, 0, 52.5, 60, 60, 52.5, 0, 60, 52.5, -60, 60, 52.5, -60, 0, 52.5, -60, ]
surf.knotvector_u=[0, 0, 0, 1, 1, 1, 1, 1, ]
surf.knotvector_v=[0, 0, 0, 0.25, 0.25, 0.5, 0.5, 0.75, 0.75, 1, 1, 1, ]
# Evaluate surface points
surf.evaluate()
# Plot the control points grid and the evaluated surface
surf.vis = VisMPL.VisSurface(vis_config)
I am still encountering the same error.
Could you also update the weights like you did for the control points? I'd try converting 0.707107
to 0.70711
and remove one significant if it doesn't work.
this is my code
and I get below error
The equivalent ACIS code
Could you please take a look at this bug ? I would greatly appreciate your assistance. Thank you in advance!