Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
Point on a Curve?
S1mon
Member Posts: 2,957 PRO
I've been looking around for a FeatureScript that would do a few things:
I also know that if I would write this imaginary FeatureScript it would help others, but I'm hoping that it exists already and I just can't find it.
- Create a point on a curve based on a parameter (0..1)
- Create a point on a curve based on chord length from chosen endpoint
- Create a point on a curve based on the distance from an arbitrary reference (plane, point, line, maybe surface?)
I also know that if I would write this imaginary FeatureScript it would help others, but I'm hoping that it exists already and I just can't find it.
0
Answers
I rediscovered that there's another FS called 3D Point (no 's') which does some similar things and some different things to your 3D Points. It looks like it hasn't been actively updated in a while, but it's popular. It seems like there could be some value in combining some of the functionality from each of these approaches into a single tool.
It says that it was created/updated by "Morgan". Anyone know who this is?
(There's also a much older, more simple FS with 3DPoints in the title that just takes a list of coordinates and creates points)
IR for AS/NZS 1100
IR for AS/NZS 1100
Part of the challenge is that points are only so useful in and of themselves. Typically they're used as the basis for other features, and there's not a clean way to stack up features parametrically like there is in Grasshopper. It would be great to add a lot of niceties to ways of specifying points and then have that available in any feature which needs points (e.g. Freeform Spline).
So what you are wanting is basically a bit like Onshape's Mate Connector feature being able to be used inside other features that use mate connectors.
IR for AS/NZS 1100
Yes. To build on that example, ideally the mate connector feature (and its use inside other features) would be even more powerful than it is. Mate connectors, planes (and coordinate systems) are basically defined all the same way inside of Onshape, yet the tools for creating MCs and planes are different. Other people have built custom features to define MCs and planes in more powerful ways, yet they are still missing from Onshape. A simple example is an MC normal to the end of a curve.
I have an IR about selection filters which is somewhat related to this. In an ideal world, there would be one feature or block or whatever we want to call it, which would be a super flexible/powerful way to create/select points, and this tool could be used to drive anything which needs a series of points.
Instead, each tool which needs a bunch of points has slightly different ways to create them. Both you and Evan have points along edges/curves based on a parameter. Your tool has an option to create a point a certain physical distance from an end. His has a face reference option (based on U/V).
Is there any progress on this topic ?
We are looking for also a way to create points on a curve with a given number of points that will be equidistant.
Thanks in ad
It seems that routing curve feature curve can achieve this
I create equally spaces points on a curve internally in my curve analyzer script
I’ve recently been using CT Points. I can’t remember right now if the other features will create a bunch of points at once the way it does.
CT Points
@S1mon I'd been wanting to add distance to 3D points for a while so I just did it.
@Sébastien_Couet I'm curious what your use-case is for the points arrayed on a curve? It's not too hard to add to the 3D Points feature, but I'm always cognizant of feature bloat.
Equidistant points or points with a given distance on a curve? Happens all the time. Think of using material for suface planking that comes in a given max width (wood strips on a boat hull, shingles on curved roof) or attachments to belts in forwarding technology or rigging technology. There are only so many criteria for non-random points on a curve: Equidistant, min/max distance, fixed distance from start/mid/end point (and each of these criteria as an absolute distance or distance on the curve). Okay, they could be spaced logatithmically, too … but we're leaving everyday terrain here.
I believe these are all trivial to write into a FS
@martin_kopplow Thanks. I get those use-cases, but I imagine they're already served by the curve pattern native feature. Would you use points for these specifically?
Always depends on the case. I'd use points meaningfully distributed along a curve as a reference to build geometry (e.g. set of different other curves) upon, while curve patterning would only reproduce several identical objects along a curve.
Seemed like a good FS challenge for me after a bit of a break. It seemed like it belonged in its own feature instead of the 3D Points one so I made Points on Curve.
You can specify a total count, or a target spacing on the curve. If you go with target spacing there are options to round to something close so it always starts and ends at the start and end of the curve. If you choose an exact spacing, you can specify a point on or near the curve to make sure that at least one point passes through there. Give it a go!
I just gave it a spin and I like it. I like that it does what it says on the box in a straightforward manner. It also helps with creating a point at a given distance from either curve endpoint, a functionality that is missing in OS built-in tools. When trying, I figured that a test use case I had in mind might require the point pattern to go along a set of curves and lines instead of a single curve. Think of the bars of a staircase banister that take sharp turns each floor and then a wide one inbetween, holes on an irregular shaped flange, things like that. Would it be possible for you change the label on the box to "Points on curves"? That's possibly going to be a bit tricky, for the remaining length of one curve would have to be taken over to the beginning of the next and so on.
Thanks to some coding help from others on the forum I've updated it to work with chains of curves here. Remove the old one from your toolbar first and replace it with this one. Now I'll be honest, I took this on to dust off some code skill cobwebs, but I don't imagine myself actually using this feature because I still don't see the use-case over curve patterning. If you end up using it somewhere I'd love to see.
@EvanReese
Wow! I'll try it very next opportunity. Thank you very much for dusting off your coding skills. :0)
Though … I just tried to add it to my toolbar (removed old version first) but got something that looks like the same, and it didn't have the "chain of curves" prompt. Will try again tomorrow.
It'll look about the same, but work with chains now.
Don't feel pushed. It is your free time.
Anyway, in case it helps, here's what I get today:
The only version (includes your link) I can find, now kind of offers me an update (blue disc icon), but then can't find a newer version of itself. Maybe it does not identify as new?
Delete that one from your toolbar and go to the latest version in the document and add the feature. I changed some internal stuff that broke the first one.
Okay, it is almost midnight, but curiosity got the better of me. I did so and now this works! Great. I like it: Simple and clear, feels like something I could actually work with.
So I played with a copy of an older model and found it kinda works for the job (limitations apply as to my application), but then it does someting interesting.
Step one, set up a model with curves, put points on curves by distance, then build curves on points, make the width of the resulting planking strips a variable:
Step Two: Change the point distance variable:
Now, that came at least unexpeted! ;0) This obviously happens for points get added from the ref points side, while I expected the ref point to act as the origin or "Point Zero" and not move. It might be better, to add and remove points on the opposite side to keep model integrity, whenever possible. Just thinking, don't know it it might be possible at all, or if, how difficult is was.
@martin_kopplow lol I wondered if this would come up and it did within the first 5 minutes it seems. I coded it originally to find whatever point was closest to the reference a just scoot the points so that closest point snapped to the reference. That does mean that the "origin" is still point #1 no matter what, but I see how that's less practical than what you expected. I tried to update it and might have even succeeded. Mind being my QC department and testing it again with V3? Shouldn't have to remove and re-add this time. Just update it.
@EvanReese Hi, I'm sorry not to get back on this any earlier. I was distracted by work, again. I'll try ASAP, but I am currently on to something that went wrong and needs urgent fixing.
Hey no rush on my end. Not sure how much more I will fiddle with this feature but it was fun.