Saturday, March 13, 2010

Improving Constraints and Relation with Shape Creation

I work for improving the usability of drawing.

My plan for now is this:
- add guideline shapes: vertical and horizontal (infinite) lines that the solver is aware of them so it will make them sticky and make more precise
- add rectangle shape for default planes (XOY, YOZ, XOZ) defined by two points. This combined with guideline lines will make hopefully a breeze to define a (more) precise rectangle from user interface.
- make possibility constraints to be interpreter based instead of function based (most code is here). This will mean that will be possible that when you click a point that is an end of an edge, to get questioned: do you want this point to be linked? and from that moment on the point will be "sticky" with the point you defined on. This can be done with actual design also but need a lot of changes from the shape creation standpoint. As the actual constraints are viewed as "external shapes" and meta-actions work just with one current shape, this will make that you cannot add constraints in the same time when you draw a line. Setting them as an interpreter, will make that possible
- I know how to create a constraint of: "middle of rectangle" or in general: "middle of a face" but yet I don't know how to create a constraint: distance from an edge (because the plane can be arbitrary, when in case of middle of a "faced shape", it's face is the plane you work on) I will need to investigate on. But I want based on the previous work to make the following constraints: - end of edge, middle of edge, middle of rectangle, middle of circle.
- improve solver to: align on main planes on rounding values (like grid values), to align to helper geometry, to ask user for constraint matching and to provide this constraint to that point

This work will hopefully take around two-three days and more on spotting bugs that may occur.

3 comments:

architect Adrian Crisan said...

Can any of these help in constraints?

SketchSolve

http://code.google.com/p/sketchsolve/

CamSketchpad

http://sourceforge.net/projects/camsketchpad/

Ciprian Khlud said...

You're right. Any of them might be useful as projects. I'm more interested on CamSketchpad but seems that is not updated for two years. At least the code may be easily translated from Java to C#. The relation of code is what I will firstly target.
Also the name of solver in NaroCAD may be inappropriate as it was a design that pretended initially to be a solver but for now it just get the "magic" (interesting geometry) around.
I will be happy to integrate a full-solver at least for 2D side.

architect Adrian Crisan said...

Yes, some of these projects are not developed anymore, and is just bad that they came a long way, and then suddenly stopped.
I wish the Open Source community is more careful with these.

Speaking of constraints, you might look into these other projects:

QCad (the community edition is Open Source, under GNU General Public License (GPL).):

http://www.ribbonsoft.com/qcad_downloads.html

At a moment of time, I have proposed to Blender developers to use QCad Community Edition and include it in Blender as a drafting tool (a more enhanced GreasePencil feature that already exist in Blender) but there was no interest into.

Archimedes, that was an interesting Open Source 2D CAD package - not developed for a long time.

http://archimedes.incubadora.fapesp.br/portal


Of course there is also PythonCAD

www.pythoncad.org

Not sure how much these projects are helpful in terms of using their developed code, just that I know of these projects, and I hoped some guys will put them together under one "roof".

Seems like you guys really work hard on NaroCAD project and that is really great.