NURBS-Python icon indicating copy to clipboard operation
NURBS-Python copied to clipboard

Slicing

Open cshorler opened this issue 4 years ago • 7 comments

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 avatar Sep 29 '19 18:09 cshorler

now successfully passes the test I wrote

cshorler avatar Oct 01 '19 20:10 cshorler

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

orbingol avatar Oct 07 '19 14:10 orbingol

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

cshorler avatar Oct 12 '19 13:10 cshorler

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.

orbingol avatar Oct 13 '19 03:10 orbingol

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.

cshorler avatar Oct 13 '19 09:10 cshorler

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

orbingol avatar Oct 13 '19 10:10 orbingol

Will do!

On Sun, 13 Oct 2019, 11:05 Onur Rauf Bingol, [email protected] 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 .

cshorler avatar Oct 15 '19 05:10 cshorler