orbingol / NURBS-Python

Object-oriented pure Python B-Spline and NURBS library
https://onurraufbingol.com/NURBS-Python/
MIT License
620 stars 154 forks source link

Slicing #68

Open cshorler opened 4 years ago

cshorler commented 4 years ago

I have a piece of code which calculates control points for an arbitrary arc using vector calculus. One possible way to achieve outputs is to pre-calculate nice fraction angular sector weights (e.g. 1/2). Only calculating the final weight explicitly, possibly this isn't a good approach for distributing the error - but what's notable is slicing is not supported, so you have to workaround this - making the code slightly less concise than it could be.

The example is for weights, but I imagine the problem / feature need is evident on all attribute lists of curves and surfaces.

I've started working on a possible way to handle this the branch below: https://github.com/cshorler/NURBS-Python/tree/slicing_and_nurbs_derivatives

cshorler commented 4 years ago

now successfully passes the test I wrote

orbingol commented 4 years ago

Thank you @cshorler. I think slicing feature will be a nice addition to geomdl.

cshorler commented 4 years ago

I'll submit a PR for v6, a little difficult now a number of tests are failing on the branch 6.x-dev. I guess you're in the middle of some changes. I'll try skipping some commits of my current base to allow the rebase to work.

==================================== 14 failed, 92 passed, 134 error in 14.65 seconds ====================================
chorler@linux-tn2c:~/projects/src/NURBS-Python> git branch | cat
* 6.x-dev
orbingol commented 4 years ago

6.x-dev is very unstable at the moment. I am doing some major refactoring to simplify some algorithms which will improve the performance in general. I will post a list of current and future changes for 6.x in a couple of days. so you will be able to track the details.

I think it would be easier for you to work with 5.x series for now, a.k.a. devmaster branch. If you can keep the changes separate from the base library (such as, via extending the classes), it will be easier to port it to 6.x later. Still, I'd like to leave this decision to you. I'd be very happy if you could directly implement on 6.x-dev, but I can say that the code in that branch is going to change a bit.

cshorler commented 4 years ago

seems to work on 6.x-dev, see PR opened. Also, the NofityList mentioned in the comment on your other enhancement is used in the implementation.

orbingol commented 4 years ago

Would it be possible to create a separate PR for the NotifyList implementation?

cshorler commented 4 years ago

Will do!

On Sun, 13 Oct 2019, 11:05 Onur Rauf Bingol, notifications@github.com wrote:

Would it be possible to create a separate PR for the NotifyList implementation?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/orbingol/NURBS-Python/issues/68?email_source=notifications&email_token=AAHKKMBF2XWQ4RNELLM4YX3QOLXFHA5CNFSM4I3TR4LKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBCS4II#issuecomment-541404705, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHKKMB7XY43C4JAHHW2V2LQOLXFHANCNFSM4I3TR4LA .