-
Notifications
You must be signed in to change notification settings - Fork 62
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
API for computing tangent and normal vectors to segments and trails #113
Conversation
For extracting individual segments from trails by parameter. This commit only includes instances for lines, need to add loops and trails.
I'm particularly interested to hear what people think of this idiom, where we have a newtype wrapper that exists solely for its instances, and the user ends up writing things of the form
In this example |
hmm, yes it is a bit strange and perhaps a tad confusing without knowing ahead of time that it's a newtype wrapper.
then you could write
|
That would work, but the downside is that feels like there's some duplication going on, e.g. we would also end up with classes However, this does suggest one possible compromise, as an aid to users: we could provide convenience functions e.g. |
Can't we assume if something has segments it also has tangents and normals. Sent from my iPhone
|
Yes, but the converse may not be true. E.g. 3D objects can be treated as parametric surfaces, and have normals, but they are not composed of segments. |
OK, this is ready to be merged if someone wants to take a look. I ended up adding functions like |
This looks good. Does anything need to be re-exported from TwoD.hs? |
API for computing tangent and normal vectors to segments and trails
Ah, good catch --- this is not 2D-specific so it should not be re-exported from |
Opening a pull request so as to have a convenient place to discuss the code, and this feature generally, while I continue to work on it. Please do not merge yet.