-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated demo and removed call to 'mathutils.geometry'. #16
base: master
Are you sure you want to change the base?
Conversation
@vvoovv: Could you please have a look at this PR? Thanks. |
Note that it is more expensive to compute the magnitude of a vector via import math
import mathutils
import time
start = time.perf_counter()
for i in range(0, 3000):
for j in range(0, 3000):
_ = mathutils.Vector((i, j)).magnitude
# _ = math.sqrt(i * i + j * j)
end = time.perf_counter()
duration = end - start
print(f'Execution time: {round(duration, 4)}') The |
Hi @costika1234, Thank you for your contributions. I'd prefer to keep The installation of
|
It is easy if you have a machine intended for development work (which most likely will have whatever libraries |
I have completely rewritten this library and managed to get rid of the That being said, I'm not sure if I should open a PR with these changes as it's going to be absolutely huge. I've reformatted all files since there were many style inconsistencies, yet I didn't change any of the original logic. |
I'd suggest to keep it as a separate fork. |
May I know how you are using the bpypolyskel library? You can reply to the email prokitektura+support@gmail.com |
I have already mentioned this here: #9 (comment). 😉 |
My bad! |
My concern is about licensing. Bpypolyskel is released under the GPL license. I hope that you use Bpypolyskel in a way that doesn't contradict the GPL license. |
I'm not distributing that SketchUp extension as it's just for personal use. That being said, this PR also addresses a bug related to the computation of the distance between a point and a line (which in the original code was handled by
This is the line of code that would cause this issue: https://github.com/prochitecture/bpypolyskel/blob/master/bpypolyskel/bpyeuclid.py#L93. In my fork I've actually replaced the analytical approach from this PR with the standard formula for computing the distance between a line and a point. Both methods yield the correct distance (up to really tiny precision errors). The current implementation, on the other hand, produces worse results in some configurations. |
Can you acknowledge the issue described in my comment above @vvoovv ? Thanks! |
I would ideally like to get rid of the
mathutils
dependency at some point, so I've just replaced the call tomathutils.geometry.intersect_point_line
with a simple Python function called_intersect_point_line
. I've also updated the demo with a new floor plan to better test the program and added a quick benchmark function. There is virtually no difference between the 2 implementations (on my machine it took about 10 seconds in each case).