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 am I not understanding (equal constraint 2 lines cannot be solved)

james_sleemanjames_sleeman Member, Developers Posts: 21 ✭✭
Constraints have been driving me crazy lately, sometimes you add what I would think to be a valid and innocuous constraint and BAM everything goes overdefined/unsolved, even if that constraint is exactly what is already pictured.  

For example, here is a video showing two lines, of equal length, one happens to be horizontal and one vertical.  I remove the dimensions, and instead select them both and mark as equal, they already are equal but I want to ensure they remain so and track each other, but nope, that don't work.

https://youtu.be/NCW9Re5YvQc

Surely if I add a constraint such as that, it shouldn't error out like that, both lines are unconstrained in length before I try the equality, I can freely grab and drag the free end of either one to make them bigger, or smaller, or whatever, so why can I manually drag them equal, but onshape can't constrain them equal.

This is just one example, I run into this sort of thing so often not just with equality or lines, it's maddening, sometimes even just moving an unconstrained thing will suddenly turn half a sketch red.

Am I missing something here?  Is this a problem that other people are experiencing?

Best Answer

Answers

  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714
    edited October 2016
    It's hard to see what's going on - can you make your doc (or a copy of it) public and paste the URL here?

    Senior Director, Technical Services, EMEAI
  • mahirmahir Member, Developers Posts: 1,309 ✭✭✭✭✭
    I believe this is a case of redundant constraints. Their position is offset, but both lines are essentially radial lines starting and ending on the same concentric arcs. By definition, they will be equal length. Adding an equal constraint overdefines the sketch. If it's really important to you to have that equal constraint, you need to remove some of the other constraints. I don't think it's a good idea, but you could delete the vertical and horizontal constraints on the lines in question. That would probably create a degree of freedom that would allow an equal constraint.
  • JAMES_SOLIDPROFESSORJAMES_SOLIDPROFESSOR Member Posts: 7

    As has been mentioned, I believe it has to do with the number of constraints that are added to your sketch. I found that I didn’t have to add any extra constraints to the sketch myself. All I had to do was sketch the segments, add a couple dimensions, and then I could fully define the sketch, including the line segments that are giving you problems. Here’s what I did in steps:

    1.      Sketch two lines along the vertical axis. The longer line extends to the first arc, and the second lines make up the width of the three arcs (which will make sense in the next step).


    2.      Draw three arcs using the “Center Point Arc” command. Make sure the center arc connects to the midpoint of the line at the top.


    3.      Draw two lines along the horizontal axis. One connects to the first arc, then the second line connects all three arcs.


    4.      Draw the line segments on the top left.


    5.      Draw the line segments on the bottom right.


    6.      Add the two line segments that you’ve been having problems with.


    7.      Convert the lines to construction, as you showed in your original video.


    8.      By this point, I haven’t added any constraints manually. The ones shown so far were added automatically as I sketched. Now add a few dimensions.


    9.      Now you can dimension the line segment on the top left, and make the one on the bottom right equal to it.


    That should work for your sketch! Hopefully you can build off of it from this point and make something great!

    James Jepsen
    Content Services Manager, SolidProfessor

    Interested in improving your CAD skills?
    www.solidprofessor.com
  • james_sleemanjames_sleeman Member, Developers Posts: 21 ✭✭
    edited October 2016
    NeilCooke said:
    It's hard to see what's going on - can you make your doc (or a copy of it) public and paste the URL here?

    https://cad.onshape.com/documents/57f6aa330084fc110e83e35d/w/4b42264ee34a9f06e557ada6/e/2729f97956811beaea704251
    mahir said:
     Their position is offset, but both lines are essentially radial lines starting and ending on the same concentric arcs. By definition, they will be equal length. 

    Nope, without the dimensions the free-end of both lines can be dragged independantly, as you can see they are therefore not by definition equal.



    As has been mentioned, I believe it has to do with the number of constraints that are added to your sketch. I found that I didn’t have to add any extra constraints to the sketch myself. All I had to do was sketch the segments, add a couple dimensions, and then I could fully define the sketch, including the line segments that are giving you problems. Here’s what I did in steps:

    I certainly appreciate your efforts but basically you are suggesting "just start the sketch again and build it with different (potentially automatically defined) constraints".  This ignores the manner in which the sketch was built up in the first place, in this case it was from a photographic reference (deleted from the sketch), but I've encountered this sort of issue in sketches that have taken hours, or been worked on over long periods of time.  Usually it's possible by trial-and-error to delete a red constraint (more or less at random) see if it helps, and if not, undo and try deleting another one.  

    The sketch in this example just isn't complicated and doesn't have many constraints so it was a good one to post about since at least as a lay-man, I would not have expected to see this sort of surprising problem with it.  Most of the constraints in it were automatically added, some of the line end points were constrained manually to be horizontal or vertical to one another.

    NB: In this example, it seems if I delete the concentric constraint between the middle arc and the outermost arc and replace it with a radius dimension (leaving the arc itself unchanged as currently represented, just changing therefore the type of constraint on it) I can then define those two line segments equal - it is not at all clear to me WHY the fact that those arcs are required to be concentric has anything to do with the lengths of those two lines, especially when the lines are already equal (but not constrained so) with those arcs having the concentric constraint.


    5.jpg 25.5K
  • james_sleemanjames_sleeman Member, Developers Posts: 21 ✭✭
    mahir said:
    After opening your document, I see why you're frustrated. It "should" work the way it was sketched,

    Thanks mahir, at least I know it's not just an error between my keyboard and chair.  I guess you are right, constraint solving is hard and unexpected issues like this will happen, but anecdotally they do seem to be happening to me a lot lately.

    The blue line hanging off the right of another sketch (a progression of the first one fwiw), who's only constraint is with one end point coincident with another point which happens to be 15mm below some other point, I want to make it horizontal by applying horizontal constraint, it's almost totally unconstrained at this point so what could possibly go wrong...



    OnShape does not agree.




  • mahirmahir Member, Developers Posts: 1,309 ✭✭✭✭✭
    edited October 2016
    Yeah, that's weird. Again, it "should" :neutral: I'd submit a bug report, but in the meantime let's see what we can do to get the sketch working. Do you really need to have all those end-to-end horizontal and vertical lines on your endcap? I suspect they're unnecessarily complicating matters. Can you replace them with one line? Same goes with the colinear construction lines. I feel like you don't need as many as you have to acheive what you're after. The only reason to have individual lines is if you want to constrain the offset between arcs to be the same, and that can be achieved with one set of colinear construction lines, not a set of lines at both 12 o'clock and 3 o'clock.

    Here's an example of a simplified approach.
    https://cad.onshape.com/documents/57f6ae7b674ab710a56b3686/w/da4fbcfb74a427aa56bf80b1/e/4429d6539600ad393b8f4f04
  • james_sleemanjames_sleeman Member, Developers Posts: 21 ✭✭
    mahir said:
    Yeah, that's weird. Again, it "should" :neutral: I'd submit a bug report, but in the meantime let's see what we can do to get the sketch working.

    Thanks, I found various ways to solve the problems in this case. In the horizontal line issue above for example, I removed the 15mm dimension on the line it was connected to, created another construction line not connected to anything, gave it a 15mm dimension, and set those two lines to be equal, which had exactly the same net-effect of constraining a line to 15mm but didn't create the unsolvability, 2 constraints solvable, 1 constraint not. Weird.

    Then later I had some other problems and ended up adjusting that sketch so it was solvable and fully constrained but incomplete in so far as the design goals and creating a second sketch on the same plane referencing the points of the first sketch so I could continue on. This works ok for my needs.

  • robert_morrisrobert_morris OS Professional, Developers Posts: 169 PRO
    I've had this happen a couple of times as well. I've also had it happen a lot in SolidWorks too (far more than Onshape I think).
    I've also had a weird one where just dragging a line's endpoint caused it to become overdefined, but that's rare.

    It's definitely a bug, but one thing that I've found (as others have mentioned) is to try simplify the sketch as much as possible - use one line instead of multiple collinear lines, fewer constraints, etc.  That usually reduces the likelihood of this happening.
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714
    edited October 2016
    I don't know if I'm lucky or just experienced, but I found the issue straight away ;)

    You have a midpoint constraint that is fighting the 16.5 or R43 dimensions - on their own they are OK together, but computers work to a finite tolerance so anything that slightly upsets the apple cart and the system doesn't know which constraints to solve - you may have added the midpoint constraint without even knowing it, but it's not a bug. There's also a point there that you can get rid of.


    Senior Director, Technical Services, EMEAI
  • james_sleemanjames_sleeman Member, Developers Posts: 21 ✭✭
    NeilCooke said:
    I don't know if I'm lucky or just experienced, but I found the issue straight away ;)

    You have a midpoint constraint that is fighting the 16.5 or R43 dimensions
    While academic at this point, if I delete that midpoint constraint and the extraneous point then I can set those two unrelated lines I showed in the video to be equal, but I can no longer then make that point where the middle arc and line meet to be at the midpoint of that line on the right.  See...

    https://youtu.be/Q00skjoa-Lc

    I mean, I hear what you're saying I think, that this is probably a fundamental limitation to do with floating point rounding, resolution, interpolation, the general complexity of constraint solving or whatever and not regard a bug to be fixed, but you have to admit, it's unpleasantly surprising from a user's perspective to see this happen.
    8.jpg 10.9K
  • Malcolm_DanielMalcolm_Daniel Member Posts: 57 PRO
    I am struggling with similar issues over and over...things that would not cause a problem in other CAD systems and don't seem to make sense cause Onshape sketches to fail.  

    I'm submitting these to support, but thought I'd commiserate since I found this post while looking for guidance.

    Here's one where an under-defined portion of the sketch blows up when I dimension a vertex that can be dragged around (so should be able to be constrained with the indicated dimension).

       


    Here's another fun one where just adding a sketch point as coincident to a line in a fully defined sketch blows everything up.

      
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714
    @Malcolm_Daniel can you post a public link to that doc?
    Senior Director, Technical Services, EMEAI
Sign In or Register to comment.