Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

3 Point Arc

Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 05-23-2008, 11:14 AM
ceaser's Avatar
Basic4ppc Veteran
 
Join Date: May 2008
Location: Paarl, South Africa
Posts: 312
Default Lets Work Together

Hi Dennishea

How about we work together on this "CAD" program? I send you what I have done so far and we can exchange ideas and routines?

Thanks
Michael
Reply With Quote
  #12 (permalink)  
Old 05-23-2008, 11:49 AM
Senior Member
 
Join Date: Jul 2007
Location: Michigan Usa
Posts: 176
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi ceaser. It is ok by me. Have you had a chance to look at what I've tried so far? I hope we can find better solution for snap to intersection, mid point, end point, ect, ect. The more gray matter the better. Looking forward to working with you ceaser.
__________________
Using 6.90
dennishea
Reply With Quote
  #13 (permalink)  
Old 05-23-2008, 11:56 AM
ceaser's Avatar
Basic4ppc Veteran
 
Join Date: May 2008
Location: Paarl, South Africa
Posts: 312
Default CAD Program

Hi Dennishea

I did not have a change to look at your snap options, I am busy with surveying Stockpiles and checking bolts on a bridge, but I will have a look this weekend and then also send you what I have so far.

Thanks
Michael
Reply With Quote
  #14 (permalink)  
Old 05-23-2008, 12:20 PM
Senior Member
 
Join Date: Jul 2007
Location: Michigan Usa
Posts: 176
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Thanks for the quik reply ceaser. Will wait for weekend to get here. Be safe and will type at you later.

p.s. I will try to program in table for recording.
__________________
Using 6.90
dennishea
Reply With Quote
  #15 (permalink)  
Old 05-23-2008, 12:39 PM
Senior Member
 
Join Date: Jul 2007
Location: Michigan Usa
Posts: 176
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Colin9876

I tried your solution for arc's and I think yours takes longer to draw. I don't know if it's I'm using pixels and your using line or what. Like I have stated in other post's I am not a Programmer so maybe you can help me understand the speed difference. If you get time maybe you could take a look at what I have done so far and point out what I need to do to make the code more ledgeable. There is a link in post 10 that has a zip file with a wordpad file and source code. Thanks for any and all comments.
__________________
Using 6.90
dennishea
Reply With Quote
  #16 (permalink)  
Old 05-24-2008, 08:44 AM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 366
Awards Showcase
Beta Tester 
Total Awards: 1
Default timing

Hi,
Yes - unfortunately due to the fact that you cant plot a single point with the .NET libary I have to draw it with connecting lines.
(form.line(0,0,1,0,cblack) wont draw just one pixel long - this is a flaw in .NET library - smallest lines being 0 points long or 2 pixels long!)

Its not slow on my device but if you want to speed it up you can double the step line to

s=2/r
because you dont really need the steps to be as small as 1/r

I looked at your code and it looks good, no major problems.
I wouldnt have done it writing to a bitmap because it seems an extra step, but given there is the .NET line bug (that you cant plot a single point) it means there is one advantage of doing it ur way

Just as a minor critique, on circle you use lable name txtr but this is actually the diameter not the radius so txtdiam would be better name! Thats why u divide it by two when calculating the radius.
In future I would tighten up the variable naming - as I said before use x,y,x1,y1 etc for co-ordinates but try and use something like l,length,ylen etc etc for lengths. Theres a few places where one minute x,y is a co-ordinate then the next its lengths lol! e.g
y2 = (y2 / 2) + Min(txty2.Text,txty1.Text)

ylen might be a clearer variable name here! Other than that its a good start!

Last edited by colin9876 : 05-24-2008 at 12:04 PM.
Reply With Quote
  #17 (permalink)  
Old 05-24-2008, 09:59 AM
Senior Member
 
Join Date: Jul 2007
Location: Michigan Usa
Posts: 176
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi colin9876. I think the main reason I use very small variables is because I'm not a typist. Erel has done such a good job with basic4ppc that even a bad programmer like me has alot less problems finding his or hers spelling mistakes and I use the term programmer loosely. I hope you keep track of what I'm trying to do and let me know when I can do better. I will go back thru my program and rename my variables with more meaningful names and repost source code. Again thanks very much for your time.
__________________
Using 6.90
dennishea
Reply With Quote
  #18 (permalink)  
Old 05-24-2008, 10:00 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by colin9876
unfortunately due to the fact that you cant plot a single point with the .NET libary I have to draw it with connecting lines
You can using the ImageLib library.

If you're going to bit-twiddle (or pixel-twiddle) don't overlook the "fast" methods in dzts' library http://www.basic4ppc.com/forum/addit....html#post8181 The not very good (written by me!) help is here dzImage

Depending upon the amount of pixel work you need doing it could be faster to assign your bitmap to a dztImage Image property, use the FastSetPixel method and then assign your image back. The fast method locks the bitmap for access only at the beginning and unlocks it at the end. ImageLib effectively locks and unlocks it for every pixel access. For many pixels the speed difference could be significant.
Reply With Quote
  #19 (permalink)  
Old 05-24-2008, 12:10 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 366
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Point taken but Im all for keeping it simple and drawing direct to the screen. Theres no reason to use dlls or bitmaps for this.
My method is fast if the raw .net line command is used.
Also I stand by what I said that the .NET line command doesn't follow convention that line(0,0,0,0) should plot a single point if line(0,0,1,0) plots 2

in fact theres no way I know with .NET to plot a single pixel, the circle fn won't do it either with r=0. Its crazy - there must b a way without using a dll?!

Last edited by colin9876 : 05-24-2008 at 12:48 PM.
Reply With Quote
  #20 (permalink)  
Old 05-24-2008, 05:53 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 4,463
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

Hi ceaser,

For the 3 point arc, is this what you are looking for ?

Best regards
Attached Files
File Type: sbp Arc3Points.sbp (6.9 KB, 16 views)
__________________
Klaus
Switzerland

Beginner's Guide / User's Guide
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fixed Point Math im4retro Questions (Windows Mobile) 3 05-31-2008 06:13 AM
Ticks as a floating point value on XP (not 2000) lancaster Questions (Windows Mobile) 4 04-09-2008 10:38 AM


All times are GMT. The time now is 07:16 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0