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.

What's the best way to center something between two points/lines/...

jeff_mcafferjeff_mcaffer Member Posts: 64 ✭✭
Say you have two parallel lines and want to center a circle between them. It would be awesome if you could add a "center" constraint where you add the two lines (or more) and the object to be centered and it just does it. To date I've been adding a construction line between the two reference objects (lines in my example here), adding a construction point midway along that line and then constraining the object (point in the example) to be vertical/horizontal/whatever to that mid-point. That's a lot of clicks. Is there a better way?

Note: I can totally see how this might get complicated in various scenarios but the simple case seems pretty common (at least in my usage) so having a simpler workflow would be great.

Thanks 

Answers

  • jeff_mcafferjeff_mcaffer Member Posts: 64 ✭✭
    I just tried out the "make several construction lines and constrain them to be equal" approach (easiest way to center 2 holes between 2 lines — Onshape). It's a bit better (and ultimately more powerful as you can draw arbitrary constraining lines), It still feels complicated and messy for a really common case. 
  • steve_shubinsteve_shubin Member Posts: 1,090 ✭✭✭✭

    How about MIDPOINT constraint 




  • Matt_ShieldsMatt_Shields Member Posts: 389 PRO
    I like the construction geometry midpoint approach.  It communicates design intent.

     
  • jeff_mcafferjeff_mcaffer Member Posts: 64 ✭✭
    That great for centering between two points. But note that adding the constraint changed both the X and Y of the point. I'm trying to center a point/line/hexagon/... between two parallel lines. So in the example orientation, just change the X position of the circle. 
  • jeff_mcafferjeff_mcaffer Member Posts: 64 ✭✭
    Construction geometry is intentional (good) but it's a bit clumsy. For example, redo your example (thanks BTW) with a centered line instead of a circle/point. And do centering after everything is drawn. As best I can tell you have to make the perpendicular construction line, add a middle construction point on that line and then constrain the target line to be coincident with this middle construction point. Lots of clicks and all the construction geometry starts to clutter the sketch. 

    IMO an explicit "centered" constraint would be just as intentional and communicative. For example, the midpoint constraint could be removed and we could all construct two parallel, equal, and end coincident lines to get a mid-point to coincide with. Instead, we have a first-class midpoint constraint.

    It might even be interesting to consider expanding the midpoint constraint to handle these sorts of scenarios...
  • Matt_ShieldsMatt_Shields Member Posts: 389 PRO
    Ah, I see your point.  Yes, "centered" would be nice.  Two not-too-clumsy workarounds below.  1) Add a centerpoint to the construction geometry and then a vertical constraint.  2) A vertical construction line and then the symmetric constraint.

  • jeff_mcafferjeff_mcaffer Member Posts: 64 ✭✭
    Interesting. I hadn't thought of using the symmetrical constraint. That will certainly work for some of the cases. Thanks.
  • MichaelPascoeMichaelPascoe Member Posts: 1,952 PRO

    @steve_shubin, I didn't know you could apply it like that. Cool!


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   cadsharp.com/featurescripts 💎
Sign In or Register to comment.