3 Point Arc

ceaser

Active Member
Licensed User
Hi Klaus

Excellent work! Only one problem. I want to drag the third point ( the last one) and not the middle point. Your formulae used seems quite involved, but I will figure it out.

I am drawing directly on the form, do you perhaps have any idea how to zoom in and zoom out, without any heavy maths?

Thanks again
Michael
South Africa
 

klaus

Expert
Licensed User
Longtime User
Hi ceaser,

Here you are for the end point.

I have not trapped the impossible cases.
As you have probably seen I use colin9868's slightly modified arc drawing routine. Thank's to colin9868, the x*s/r step for the angle is really intersting.

For the zoom fucntion, could you explain more in detail what you want to do to better understand your problem and give more accurate advices.

Do you want to draw on the zoomed gaphic ?
This would determine if you need vector graphics or using only bitmap graphics ?
In vector graphics you will need a scaling factor.

At my knowledge you cannot zoom directly on the form you will need at least an intermediate bitmap with bigger dimensions than the device screen and work with the ImageLib or dzImage libraries.

Is it an application for the device, or desktop only, for the screen size?

I used the zoom function of the dzImage library in my Map display application but without any drawing on.

I have joined the equations for a circle defined with 3 points on it's circumference, just as a reminder for some geometry.

Best regards
 

Attachments

  • Arc3Points1_1.sbp
    8 KB · Views: 249
Last edited:

ceaser

Active Member
Licensed User
Cad

Hi Klaus

Thanks for those formulae. I did not get a chance to have a look at them, but I shall do that later.

The CAD that I am trying to write must be based on vectors. I am a Land Surveyor and all the info that I record is based on distance and bearings, which in turn calculates the coordinates for me.

That's one of the reasons why I moved over to Basic4ppc from NSBasic. I wrote my whole surveying program in NSBasic and when I was ready to add some CAD functions to it, I found it very limited.

Anyway, I am going to add what I have done up to now on my CAD attempt.

Thanks
Michael Papenhagen
 

dennishea

Active Member
Licensed User
Hi ceaser.
I took a look at your cad and have :sign0188: for what you have so far.
 

klaus

Expert
Licensed User
Longtime User
Hi ceaser,

I had a first look at your program, it's a very good beginning !

Unfortunately I have some bad news. If you want to use the program on a PPC the use of the Toolbars will not work.

There is a big difference between the destop and the device. On the device the ONLY place for ToolbarButtons is the place left in the menu bar. And if there are more buttons than place the buttons in excess will not appear. I already had this 'frustration'.

You will need to use ImageButtons instead of the Toolbars !

I will look further and come back.

Best regards
 
Last edited:

ceaser

Active Member
Licensed User
Cad

Hi Dennishea

Thank's for your comments. What I will do, is as I add new stuff and sort out the bugs, I will post them on the forum for your comments. But please I need HELP!!:sign0085:

I am busy rewriting my program (Land and Engineering Surveying), which has been done in NSBasic and I need to rewrite it as soon as possible in Basic4ppc. The program is at the moment still running on the Workabout from Psion, but everybody is waiting now for the Windows Mobile version.

The suit consists of the main program (CEASER), then a "Design" input (Horizontal alignments, Vertical alignments, crossfalls, surface widths, coordinates, etc), a "Field" module (checking and placing of pegs, Tachy Survey, etc), a "Cogo" module (Joins, Polars, Intersections, etc), a "Stock" module for measuring stockpile volumes in the field, a "Map" module which allows you to bring up a background map and sync it to your GPS.

The CAD is something new that I want to add.

By the way, Ceaser stands for Civil Engineering and Surveying Earthworks Routines!

Thanks
Michael
:sign0144:
 

ceaser

Active Member
Licensed User
Cad

Hi Klaus

Thanks for that advise. I will change the toolbar for something else. It is just unfair for beginners like us to give us something (i.e. Toolbars) and then it does not work as we think it should.

Regards
Michael:sign0148:
 

klaus

Expert
Licensed User
Longtime User
Hi Michael,

If you agree, I would be pleased in going further with your program. The subject tickles me a bit.

I don't know if once you had a look at the Icon Editor or the Dynamic Simulations programs, there are toolboxes in with ImageButtons.
http://www.b4x.com/forum/share-your-creations/1715-icon-editor.html
http://www.b4x.com/forum/share-your-creations/2043-dynamic-simulations.html

In the Dynamic Simulations program, in the graphics module, the toolbox can be displayed or hidden to enlarge the working area. And with the transparent property the color is changed to show if the button is pushed or not.

With the ImageButtons on a panel or on the main form there is one advantage, the button size is choosen by the programmer and not imposed by the OS, which allows having more buttons on a the same area.

From what I have seen, I would suggest that the main functions (New, Load, Save etc.) remain in the menu bar. And the other buttons perhaps on two toolboxes, one on top and one on the side depending on the kind of functions.

If you agree, post your last version and I will go further. Can you please also join some comments on the different buttons. Most are obvious but not all. And then there will for shure come much more questions.

Best regards.
 

Cableguy

Expert
Licensed User
Longtime User
Hi ceaser,


I have joined the equations for a circle defined with 3 points, just as a reminder for some geometry.

Best regards

I was under the impression that a circle required just 2 point and that the distance between them would be the radius, or are you talking about elipses too?
 

klaus

Expert
Licensed User
Longtime User
Hi Paulo,
To define a circle you nead three points.
The case you are mentionning is the special case at the diameter where the 3rd point is at the same distance (the radius) from the center as the two others, in all other cases you need 3 of them.

You can have a look at:
Circle - Wikipedia, the free encyclopedia
Under Properties, the last point:

Through any three points, not all on the same line, there lies a unique circle. In Cartesian coordinates, it is possible to give explicit formulae for the coordinates of the center of the circle and the radius in terms of the coordinates of the three given points.
That's what I did.

For an ellipse the equations would be different. It's the locus of points such that the sum of the distance to two fixed point (focus) is constant. The circle is a special case where the two focus points are the same.
Ellipse - Wikipedia, the free encyclopedia

Best regards.
 

Cableguy

Expert
Licensed User
Longtime User
So if I understand you correctly, none of those three points is the center, rigth?
 

Cableguy

Expert
Licensed User
Longtime User
They all 3 lie on the circumference.

OK, now I understand...
As Andrew usually says, just to be "pedantic", it's a matter of shoosing the correct words, as a circunference differs from a circle, exactly in its "points needed to define it"...:sign0161:
Its the same with a rectangle (wich assumes that all 4 angles are 90º) and a Trapezoid, wich can also be a Rectangle...

I remember now why I flawed at geometry.....:sign0137:
 

ceaser

Active Member
Licensed User
Cad

Hi Klaus

Thanks for your offer to help me:sign0060:, but I need to know what it is going to cost me. You must bear in mind that the "CAD" module will form part of the "CEASER" program, which is a commercial software package on the market. I have users throughout Africa, Britian, China and Australia.

If you agree to this, then I will send you a list of the meaning of the buttons on the toolbars. I am busy moving everything over to panels and I will send it to you during the course of tomorrow. I have quite of lot of fieldwork that I must do today.

I am also going to work on a couple of routines during the week and towards the end of this week, I will put it on the forum again.

Thanks
Michael Papenhagen
 

klaus

Expert
Licensed User
Longtime User
Hi Micheal,

Programming has been a hobby for many years now and of course still is !
I program for my pleasure and as I wrote in a previous post the subject interests me. So I don't want to get any payment for, even it will be a comercial product.
The only point, for me, is that the program remains public to the forum members. I got many help on this forum, and it would be a contribution of mine.

Next week I will be abroad, and will probably not beeing able to do any work on. But anyway I am going to start with. It seems that there is some interest from other forum members. I intend to make it 'universal' perhaps up to you to add or modify some very specific functions.

Best regards.
 

ceaser

Active Member
Licensed User
Cad

Hi Klaus & Dennishea

I am attaching a interface screen that is a bit modified. I have got rid of the toolbars and I have made use of panels and imagebuttons. I will add a small toolbar later to enable the user to select a layer that needs to be drawn on plus a small menu.

I will concentrate this week on the actual drawing routines and the snap options.

Something that also needs attention is the different coordinate systems. A normal cad will have it's minimum values (Y & X) in the top left corner and the maximum values in the bottom right corner. In the South African survey system, we have the minimum values (Y & X) in the top right corner and the maximum values in the left bottom corner.

Regards to all
Michael
 

klaus

Expert
Licensed User
Longtime User
Hi Michael & Dennishea,

In my mind a CAD system has the minimum X and Y values in the lower left corner, at least for what I have seen in 2D mechanical engineering CAD systems. That means already 3 systems (we are just missing the lower right corner).

How do you imagine the scaling, as I have seen, you use bitmap drawing and the resolution is one pixel. Depending on the displayx area scaling the resolution coud become relatively lerge.

And what about saving, bitmap or anything else ?

How will you handle the zoom ?

I have in mind to use vector graphics where we save the phisical coordinates and draw on a given display area with a scaling factor for the pixel. The accuracy is always maintained. The open question for me is the speed of the display refresh with a big number of elements (points, lines, surfaces).
I have begun a program, with a vector structure and will submit it as soon as there are some graphic functions working.

I think we should either open a new thread in the Open Source Projects directory or continue in Dennishea's Drawing program thread.

Best regards.
 
Last edited:

dennishea

Active Member
Licensed User
Hi ceaser and klaus.

I think klaus is right about moving to another thread. The drawing program in open projects is fine by me, also I updated the zip file in my open source project. I added a table to start figuring how to save data. I don't have it any where near done but it is good enough for any one to say hey there's a better way. A little over a month ago my desktop died and I lost most of my work on this. I believe I have already said this once but I am not sure. That's what getting near your retirement age and prescription drugs do for you.

:)
 
Top