This project is read-only.

Idea to add "constraints"

Aug 21, 2009 at 3:55 PM

This tool is really awesome. It's similar to the skectch environments of the current CAD modelling packages like Autodesk Inventor, SolidWorks, Alibre, etc. I've used each of these often over 25 years of CAD experience. I wanted to suggest a few things for you to consider adding to your tool, if you want to keep expanding it functionalilty.

1. The ability to add contstraints to line segments *AFTER* they are created, specifially "Horizontal" and "Vertical".  The commercial packages I mentiond above all have these two constraints and it is one of the foundational steps of creating a sketch. Often, like in a square, you first draw the square at any arbitrary angle, then add a Horizontal constraint to the botom segment, and since the other segments are alreay linked by "Perpendicular" contstraints, the entire square will then re-align based on this one new contraint.

2. The ability to apply a "Perpendicular" contraint between two existing line segments.  Your tool already has Perpendicular segment, but requires it to be done at the time of creating the segment, and it also make an infinite length line, whereas you often want to apply a Perpendicar constraint to existing segments that are of finite length.

3. The ability to add a "Coincident" constraint between two existing points. Again, your tool certainly has the concept of Coincident contraints, but again, they must be applied at the time of creation, whereas the commercial packages allow you to add this "Coincident" constraint after the fact.

4. The ablity to "Trim" segments. So that if you have lines or arcs that intersect (and cross each other), you can trim off the part you do not want and it trims is back and creates.

It's interesting (and actually a common workflow) to draw a bunch of disconnected segments, then begin applying the Coincident, Hor, Ver, Perpendicular constraints, and a few Trim operations and watch your sketch come together into a fully constrained skectch.


Aug 21, 2009 at 7:20 PM

Wow, these are nice ideas Matt. I haven't had any exposure to CAD tools so this is certainly helpful. This definitely goes into my to-do list.

Also, you can potentially do more along these lines - put a constraint on a point to be always a given distance away from another point (constrain it to a circle), fix the angle between three points, etc. This way you can model linkages or "matchstick"-constructs that have certain degrees of freedom but are fixed otherwise. I also need to look more into, as you say, converting lines to segments and rays by clipping, allowing rays and segments to be perpendicular, etc.

Aug 21, 2009 at 10:24 PM

I  second matt's opinion that is a really awesome tool.   I think you have done a great job in building a framework that takes a sketching approach (see CAD mentioned by Matt).  There are alot of packages out there that do a drawing approach (e.g., inkscape, exp. design, illustrator, ), but none really give you good ways to create plane geometry.  Hope you continue with the project!