FB CAD

User projects written in or related to FreeBASIC.
Post Reply
MystikShadows
Posts: 612
Joined: Jun 15, 2005 13:22
Location: Upstate NY
Contact:

Post by MystikShadows »

Oh..now I get it :-). Yeah, I don't think circle handles that...but hey, if anyone knows, and I'm wrong, do correct me ;-).
owen
Posts: 555
Joined: Apr 19, 2006 10:55
Location: Kissimmee, FL
Contact:

methods of drawing interface

Post by owen »

in the case of drawing a circle, in most applications, the first mouse click sets the center point of a circle and the second mouse click sets the radius.

as i investgate ideas for implimenting ellipses in fbcad, i thought of the idea to add an Additional method of drawing circles and that is:

first mouse click sets one side of the circle and second mouse click sets it's diameter.

please let me know if this is unique, in which case it will be pretty cool.

the reason behind this thought is an idea about what mouse clicks represent what attributes of an ellipse in the process or method of drawing the ellipse.
MystikShadows
Posts: 612
Joined: Jun 15, 2005 13:22
Location: Upstate NY
Contact:

Post by MystikShadows »

I think so, I've seen them adjust both at the same time, not one or the other...atleast not with the mouse...I guess using the arrow keys you might be able to achieve this...so yes, it would be unique.
owen
Posts: 555
Joined: Apr 19, 2006 10:55
Location: Kissimmee, FL
Contact:

drawing a circle between two points

Post by owen »

Circle (x1+(x2-x1)/2,y1+(y2-y1)/2),Sqr((x1-x2)^2 + (y1-y2)^2)/2

x1,y1 is the mouse location on first click
which is the end point of the 1st line on the left

x2,y2 is the mouse location on second click
which is the end point of the 2nd line on the right

holding the shift key down while drawing the circle is now in the code


normally one would have to draw a line between the two end points of lines 1 & 2 and draw the circle by snaping to the mid point of the line in between the two points.
Last edited by owen on Apr 24, 2010 6:12, edited 1 time in total.
owen
Posts: 555
Joined: Apr 19, 2006 10:55
Location: Kissimmee, FL
Contact:

arcs

Post by owen »

this second way of drawing circles also applies to drawing arcs.

drawing an arc uses 3 mouse clicks
1st click defines the arc's center point
2nd click defines the arc's radius and beginning point of the arc
3rd click defines the arc's end point

as an option: using the shift key while drawing the arc will automatically shift the arc's center point between mouse clicks 1 and 2. after mouse click #2, release the shift key as it no longer applies while adjusting the arc's swing.
owen
Posts: 555
Joined: Apr 19, 2006 10:55
Location: Kissimmee, FL
Contact:

ellipses

Post by owen »

ok, ellipses is partially coded.
just like drawing circles, you have to methods of defining the ellipse' center point (using the shift key or not).

things that are pending:
createellipse (saves in array)
detection of ellipse
box selecting
saving dxf
MystikShadows
Posts: 612
Joined: Jun 15, 2005 13:22
Location: Upstate NY
Contact:

Post by MystikShadows »

very nice lineup of features :-).
fsw
Posts: 260
Joined: May 27, 2005 6:02

Post by fsw »

3rd way of drawing arcs (from an EDA program I use):

uses 3 mouse clicks
1st click defines the arc's start point
2nd click defines the arc's end point
3rd click defines the middle point (between the start and the end point) and with that the radius

The 3rd click could also define the center...

Good work Owen.
Keep it coming...
owen
Posts: 555
Joined: Apr 19, 2006 10:55
Location: Kissimmee, FL
Contact:

elliptical arc

Post by owen »

ellipses and elliptical arc are done
pending is save dfx for ellipses

thanx for 3rd way to draw arc, i'll look into it.

to draw an ellipse
first click sets center point (shift key option is available)
second click sets major radius and angle at same time
third click sets second radius

elliptical arc use the same first three clicks
4th click start angle
5th click end angle
fsw
Posts: 260
Joined: May 27, 2005 6:02

Post by fsw »

@Owen
Do you plan to make the program of yours 3D, adding the Z plane?
Do you plan to switch to FB current CVS anytime soon?
Do you plan to use a real GUI some point in time?
Which OS are you using? (Windows, Linux or DOS)
owen
Posts: 555
Joined: Apr 19, 2006 10:55
Location: Kissimmee, FL
Contact:

wish list

Post by owen »

Do you plan to make the program of yours 3D, adding the Z plane?
prior to 3d are several pending 2d goals: note (pls add your wish list)
objects: multi-lines, polylines, polygons, splines, hatches, blocks, text, dim
edit features: multi-copy, stretch, trim, scale, extend, multi level undo.
snap features: tangent, intersection, quadrants or points of circles @ x degrees
layer features: change current layer of objects to x layer, lock layers
also prior to 3d, i really want to add animation, motion, timing etc...

Do you plan to switch to FB current CVS anytime soon? not yet.

Do you plan to use a real GUI some point in time?
i would like to but i don't know how.

Which OS are you using? (Windows, Linux or DOS) winxpprosp2
obelisk
Posts: 2
Joined: Jul 16, 2006 1:34

Post by obelisk »

Is there a way to enter coordinates manually when creating entities?
owen
Posts: 555
Joined: Apr 19, 2006 10:55
Location: Kissimmee, FL
Contact:

manually entering coordinate

Post by owen »

thanx for noticing there was no way to manually enter coordinates. i was delaying to impliment this idea in lieu of a command line (textbox or textarea)...
i really appreciate you noticing this. to me that's way cool.

what i did was add a sub routine that allows you to enter the xy, and z (in the future) coordinates by pressing "X","Y", or "Z" (uppercase xyz)...

what this does, is it allows you to do set the coord's of 2 situations.
for example:
1. when drawing a line, circle, arc, etc... you are setting END points.
2. when NOT drawing... you are setting the begining points or center of a circle.

when using this feature, look in the upper left area of the screen, just above the buttons. (this is my temporary command line entry area)

also, i noticed that while drawing elliptical arcs, there was a discrepancy as to what angle the start and ends were actually equal to. it's a matter of relativity. i made the my changes so now by default, the start and end angle will follow the mouse. as an option you can hold the shift key down and force the start / end angles to be relative to the ellipse itself.
Last edited by owen on Mar 13, 2007 19:38, edited 2 times in total.
owen
Posts: 555
Joined: Apr 19, 2006 10:55
Location: Kissimmee, FL
Contact:

what is 45 degrees example

Post by owen »

my last note was to report a discrepancy about the angles involved in ellipses. so here's an example of what i meant.

when drawing an elliptical arc by default, the start angle will follow the mouse and if the mouse is 45 degrees in respect to the center of the ellipse then the arc's starting point will be where the red and cyan lines intersect.

and if the mouse is 45 degrees
in respect to the center of the ellipse then...
if holding the shift key down while defining the arc's start angle, then the start point will be that of the intersection of the blue and cyan lines.
Last edited by owen on Apr 24, 2010 6:13, edited 1 time in total.
owen
Posts: 555
Joined: Apr 19, 2006 10:55
Location: Kissimmee, FL
Contact:

oops

Post by owen »

this is only the case if the ellipse is not skewed (i.e. @ zero degrees or vertical)... i thought i had it nailed. oh well, that's what makes it fun. i'll work on it some more later today.
Post Reply