← Back to team overview

kicad-developers team mailing list archive

Re: HPGL

 

Thanks Edwin, this could be helpful for Andreas.

This is for Andreas.  He is learning how to fish, and hopefully benefit the project in the
future.

(I will never use HPGL, and don't give a crap about it. If somebody just wants to fix it,
go ahead. In the mean time we've learned how to use patch, and the difference between a
verbal code correction and a patch.)

I would hope Andreas would look at your document and come up with, ah something, say a
patch. 

Andreas, the macros in in */include/macros.h, starting at line 69 could be used if we
avoided dividing by 10 so early.  There is a movement towards degrees from tenths of
degrees, but currently the angle you get from the C++ object is in tenths of degrees. 
That is why I reluctant to propagate more use of these tenth's macros.

We are alway looking for general solutions.  Something similar to NORMALIZE_ANGLE_POS but
in degrees, not tenths.  But the C++ template I offered might be close, if you adjust <
with <= , the endpoints, etc.

I will commit the patch when it looks good.  I need not contribute more than that at this
point.



> Hello Dick,
> I found a document online :
> http://www.hpmuseum.net/document.php?catfile=213
>
> As I read it, angles should be allowed to -360.. +360 at least.
> But I could be wrong...
>
> Hope this helps a bit..
> Happy weekend,
> Edwin van den Oetelaar
>
> quote :
>
> Purpose
> To outline any wedge. Use EW to draw sections of pie charts.
> Syntax
> EW radius,start_angle,sweep_angle,[,chord_angle][;]
> Parameter Functional Range Parameter Default
> radius current units device-dependent no default
> (at least –223 to 223 – 1)
> start_angle clamped real –32 768 to 32 767 no default
>          (modulo 360)
> sweep_angle clamped real –360° to +360° no defaultchord_angle*
> *
> Format clamped real 0.0° to 360° device-dependent
>             (usually 5°)
> If you have used the “CT1” instruction, the chord_angle is interpreted
> as a deviation dis-
> tance in current units; see the CT instruction on page 133.
>
>
> On Sun, Feb 3, 2013 at 4:20 PM, Dick Hollenbeck <dick@xxxxxxxxxxx> wrote:
>> Is this the allowed range?
>>
>> -180 =< degrees < 180
>>
>> On Feb 3, 2013 9:09 AM, "Dick Hollenbeck" <dick@xxxxxxxxxxx> wrote:
>>> This is not done yet.
>>>
>>> The problem with this approach is we've yet to achieve a full
>>> understanding.
>>>
>>> Not all angles in a circle can be normalized into +179 to -180.  eg 179.1
>>> and what about 179.9
>>>
>>> So the code "looks like a guess" rather than a reasoned solution.
>>>
>>> Can you make it handle 179.9 degrees?
>>>
>>> On Feb 3, 2013 5:48 AM, "Andreas Beutling" <andreas@xxxxxxxxxxxx> wrote:
>>>> Hello,
>>>>
>>>> without NormalizeDegrees it works ok in all tested directions. Changes:
>>>>
>>>>
>>>>     // degrees = NormalizeDegrees( -180.0, degrees, +179.0 );
>>>>
>>>>         while( degrees > 179 )
>>>>                 degrees -= 360;
>>>>         while( degrees < -180 )
>>>>                 degrees += 360;
>>>>
>>>>     // Calculate start point,
>>>>
>>>>
>>>> See the attached image.
>>>>
>>>> Regards, Andreas



Follow ups

References