What is the current behavior?
bspline local discretization giving bad results
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem Avoid reference to other packages
import math
import time
from itertools import product
import matplotlib.pyplot as plt
import mplcyberpunk
import numpy
plt.style.use("cyberpunk")
from dessia_common.core import DessiaObject
import dessia_common.core
import volmdlr
from volmdlr import edges, primitives3d, wires, surfaces
from volmdlr.core import EdgeStyle
import time
time_s = time.time()
edge, start, end = DessiaObject.load_from_file('/Users/wirajandasilva/Downloads/test_bspline_local_discretizations_291223.json').primitives
discretized_points_between_1_2 = edge.local_discretization(start, end, 10)
ax = edge.plot()
for p in discretized_points_between_1_2:
p.plot(ax, 'c')
start.plot(ax, 'r')
end.plot(ax, 'b')
print("start abscissa: ", edge.abscissa(start))
print("end abscissa: ", edge.abscissa(end))
print("point at abscissa start :", edge.point_at_abscissa(edge.abscissa(start)).is_close(start))
print("point at abscissa end :", edge.point_at_abscissa(edge.abscissa(end)).is_close(end))
print("first point abscissa: ", edge.abscissa(discretized_points_between_1_2[0]))
print("last point abscissa: ", edge.abscissa(discretized_points_between_1_2[-1]))
#
print("point at abscissa first point :", edge.point_at_abscissa(edge.abscissa(discretized_points_between_1_2[0])))
print("point at abscissa last point :", edge.point_at_abscissa(edge.abscissa(discretized_points_between_1_2[-1])))
[test_bspline_local_discretizations_291223.json](https://github.com/Dessia-tech/volmdlr/files/13793111/test_bspline_local_discretizations_291223.json)
* **What is the expected behavior?**
* **What is the motivation / use case for changing the behavior?**
* **Possible fixes**
* **Please tell us about your environment:**
- branch: dev
- commit:
- python version:
I'm submitting a ...
What is the current behavior? bspline local discretization giving bad results
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem Avoid reference to other packages
import matplotlib.pyplot as plt import mplcyberpunk import numpy
plt.style.use("cyberpunk")
from dessia_common.core import DessiaObject import dessia_common.core import volmdlr from volmdlr import edges, primitives3d, wires, surfaces from volmdlr.core import EdgeStyle import time time_s = time.time()
edge, start, end = DessiaObject.load_from_file('/Users/wirajandasilva/Downloads/test_bspline_local_discretizations_291223.json').primitives discretized_points_between_1_2 = edge.local_discretization(start, end, 10) ax = edge.plot() for p in discretized_points_between_1_2: p.plot(ax, 'c') start.plot(ax, 'r') end.plot(ax, 'b')
print("start abscissa: ", edge.abscissa(start)) print("end abscissa: ", edge.abscissa(end)) print("point at abscissa start :", edge.point_at_abscissa(edge.abscissa(start)).is_close(start)) print("point at abscissa end :", edge.point_at_abscissa(edge.abscissa(end)).is_close(end))
print("first point abscissa: ", edge.abscissa(discretized_points_between_1_2[0]))
print("last point abscissa: ", edge.abscissa(discretized_points_between_1_2[-1]))
#
print("point at abscissa first point :", edge.point_at_abscissa(edge.abscissa(discretized_points_between_1_2[0])))
print("point at abscissa last point :", edge.point_at_abscissa(edge.abscissa(discretized_points_between_1_2[-1])))