Open shimwell opened 3 years ago
I noticed that a while ago, and it was a tad annoying 😸
Another related problem is that if one wants to reuse the points in another shape then I think they will have been modified by the first shape and potentially unusable in the second shape
shape1 = paramak.RotateStraightShape(
points= [
(100, 0),
(200, 0),
(250, 50),
(200, 100),
]
)
# shape1.points is now a list with connections not what the user originally input
shape1 = paramak.RotateSplineShape(
points= shape1.points
]
)
One way to solve this would be to have two separate attributes points
and connections
.
One would only contain coordinates and the latter will only contain strings?
Or perhaps another version of points called processed_points or something like that
@Shimwell I think this can be closed since it was solved in #839
Do you mind if I keep it open a bit longer, I need to get that example I posted a few comments up working
Points is passed by the user and changed internally by the class (perhaps this is poor program design).
One change adds the start point as the end point to make a closed wire. This is nice as it saves the user time and having to make that last point which the program can easily figure out.
It also checks that the input first and last points are not the same.
Anyway the points is pass as a list which is mutable.
Therefore the list values are changed and can't be reused. This simple example produces an error.
Perhaps we should not change the points that the user inputs by make a copy and change the copy?