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.

Mid-surface Custom FeatureScript

romeograhamromeograham Member, csevp Posts: 704 PRO

Has anyone made a Custom FeatureScript that creates a surface body that is mid-point between two faces? This seems kind of straightforward for planar surfaces (a mid-plane Plane would work) but would likely become challenging with curvature. Two cylindrical faces? Maybe easy, if their axes are coincident. Two conical faces? Same: maybe easy if they share an axis. One could imagine all sorts of face-pairs that would make this really tough though….

But for cases where you have a part with generally-constant wall thickness but want to find the surface in the middle of the part (could be the place in a beam that lies between compression and tension - I'm sure there's a name for this region, or the mid-surface between the drafted faces of a rib feature etc etc)…is there a Custom FS already out there that I have missed?

It would be reasonable if this Custom feature script worked with face-pairs…and if you added them together, it would automatically extend the surface bodies and trim them together. If the face-pairs aren't arranged to allow a single surface body result, it could just produce multiple surface bodies.

Just curious…

Comments

  • S1monS1mon Member Posts: 3,318 PRO

    If the two surfaces are parameterized identically (or one can be elevated or re-parameterized to be identical) then creating a new surface with all the CVs being averages of the respective CVs should work. As you say, there are likely a lot of cases which would be odd or challenging. Do you untrim the input surfaces? If they are two planes do you treat them as infinite and create another plane?

    Extending this beyond two input surfaces to bodies where the surfaces needed to be paired up would be really tricky.

  • Derek_Van_Allen_BDDerek_Van_Allen_BD Member Posts: 45 PRO

    I've been working on a curve tweening script this weekend actually, which is a few dimensions away from a mid-surface script. I just got done handling the cases where the CVs match and have been implementing the elevation logic for those mismatched cases. Originally I was just parameterizing by curve length segments but that wasn't very robust at local curvature. The final version is probably going to spit out everything as some kind of splines simply to avoid the massive switch statement mapping every possible input geometry to every other possible input geometry.

    I did also write a "find me all face pairs" script the other week as well for a different project that I'm publishing later this week.

    image.png
  • MichaelPascoeMichaelPascoe Member Posts: 2,315 PRO

    .

    I can't think of any that have already been written. Would be a neat feature though.
    May take a few extra steps then what you were imagining, but it looks like Derek's feature could work for what your trying to do.

    @romeograham Let me know if your need gets serious and you end up needing a developer for it. I can connect you with CADSharp. 😎

    .


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   Learn How to FeatureScript Here 🔴
Sign In or Register to comment.