Jump to content
Developer Wiki and Function Reference Links ×

polar/vector input???


Recommended Posts

Why do neither of these Poly(); not create an equilateral triangle with 15mm sides?

first point is cartesian, second and third are intended to be polar.

 

d1:=15.000000mm;

ClosePoly;
    Poly(0,0,  d1,#0.000000d,  d1,#150.000000d);

ClosePoly;
    Poly(0,0,  #0.000000d,d1,  #150.000000d,d1);

Link to comment

You need a Relative; before your code.

ClosePoly; sets the mode to close polygons, it does not close the polygon just drawn. It is a toggle.

Your angels for equilateral should be 120° instead of 150.

 

Try this:

 

Procedure Test;

VAR	d1	:Real;

Begin

Relative;
ClosePoly;
d1:=15.000000mm;
{ClosePoly;}
	Moveto(0,0);
    Poly(d1, #0.000000d,  d1, #120.000000d);
{    Poly(0,0,  #0.000000d, d1,  #150.000000d, d1);
 }   
End;

Run(Test);

 

Link to comment

omg! Thanks.

As soon as you mentioned Relative; I recalled that I had done this once before a few years ago. I think that I am missing the obvious path to finding out these basics.

I am always expecting the function and procedure reference to give me that insight into those basic aspects of the compiler but never find them. The old help used to have compiler basics in it but I'm not sure where it has migrated to these days.

 

I was fumbling around trying to close the result of RegularPolygon and was getting to the point of wanting a workaround by using polar vectors in the Poly procedure.

In the end I was able to figure out how to close the result of RegularPolygon and eliminate the extra point at the start vertex.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...