Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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?

S1monS1mon Member Posts: 3,039 PRO
I've been looking around for a FeatureScript that would do a few things:
  • 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 know that there are things like MultiMateConnector or some of the fancy Plane FeatureScripts which would get me part of the way on some of these. There are ways to do some of these with multiple features or sketches, but I'd like a simple single feature that I can put a variable into and use for patterning.

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.

Best Answer

Answers

  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭
    Answer ✓
    3D Points can at least do the first one.
    Evan Reese
  • S1monS1mon Member Posts: 3,039 PRO
    @Evan_Reese
    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)
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714
    Senior Director, Technical Services, EMEAI
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,050 ✭✭✭✭✭
    @S1mon That's me 😉 
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,050 ✭✭✭✭✭
    That FeatureScript was pretty much just created, then forgotten about. I don't actually use it myself, so I haven't kept it updated very well. But either way, improvement requests for it are welcome. 
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • S1monS1mon Member Posts: 3,039 PRO
    Ultimately what I'd like to see is a native feature for creating 3D Points which is a bit of a combination of the @Evan_Reese and @MBartlett21 FeatureScripts (I should put this into an Improvement request). 

    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).
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,050 ✭✭✭✭✭
    @S1mon
    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.

    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • S1monS1mon Member Posts: 3,039 PRO
    @MBartlett21

    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). 

  • Sébastien_CouetSébastien_Couet Member, csevp Posts: 10 PRO

    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

  • Sébastien_CouetSébastien_Couet Member, csevp Posts: 10 PRO

    It seems that routing curve feature curve can achieve this

  • joshtargojoshtargo Member Posts: 264 EDU

    I create equally spaces points on a curve internally in my curve analyzer script

  • S1monS1mon Member Posts: 3,039 PRO

    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

  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭

    @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.

    Evan Reese
  • martin_kopplowmartin_kopplow Member Posts: 532 PRO

    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.

  • joshtargojoshtargo Member Posts: 264 EDU

    I believe these are all trivial to write into a FS

  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭

    @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?

    Evan Reese
  • martin_kopplowmartin_kopplow Member Posts: 532 PRO

    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.

  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭

    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!

    Evan Reese
  • martin_kopplowmartin_kopplow Member Posts: 532 PRO
    edited November 5

    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.

  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭

    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.

    Evan Reese
  • martin_kopplowmartin_kopplow Member Posts: 532 PRO
    edited November 10

    @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.

  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭

    It'll look about the same, but work with chains now.

    Evan Reese
  • martin_kopplowmartin_kopplow Member Posts: 532 PRO

    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?

  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭

    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.

    Evan Reese
  • martin_kopplowmartin_kopplow Member Posts: 532 PRO
    edited November 12

    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.

  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭

    @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.

    Evan Reese
  • martin_kopplowmartin_kopplow Member Posts: 532 PRO

    @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.

  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭

    Hey no rush on my end. Not sure how much more I will fiddle with this feature but it was fun.

    Evan Reese
  • CrusoeCrusoe Member Posts: 5 PRO

    now CT Points (https://cad.onshape.com/documents/431001f3ab91995c47ba6ed6/w/5e9df1075d3421cf9a79e741/e/170e901b21b8387245d0668e) custom feature supports creating points closest to a given reference

Sign In or Register to comment.