public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* (kawa pictures) procedural interface for point and dimension?
@ 2016-10-23 22:23 Sudarshan S Chawathe
  2016-10-23 23:09 ` Per Bothner
  0 siblings, 1 reply; 4+ messages in thread
From: Sudarshan S Chawathe @ 2016-10-23 22:23 UTC (permalink / raw)
  To: kawa

I have a feeling I may have missed or misread something obvious, but I
didn't find an answer to:

What is the recommended way to create points (and dimensions)
procedurally in the (kawa pictures) library?

I realize that we can always use the underlying Java Point2D class to
create points, but that method seems messy given the overall simplicity
provided by the library.  A use case would be generating some random
points to be connected by lines.

By the way, I find the pictures library to be fun.  I especially like
the SVG output feature.  Thanks for adding it (and for kawa)!

Regards,

-chaw

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: (kawa pictures) procedural interface for point and dimension?
  2016-10-23 22:23 (kawa pictures) procedural interface for point and dimension? Sudarshan S Chawathe
@ 2016-10-23 23:09 ` Per Bothner
  2016-10-23 23:54   ` Sudarshan S Chawathe
  2016-10-24 14:25   ` Sudarshan S Chawathe
  0 siblings, 2 replies; 4+ messages in thread
From: Per Bothner @ 2016-10-23 23:09 UTC (permalink / raw)
  To: kawa



On 10/23/2016 03:22 PM, Sudarshan S Chawathe wrote:
> I have a feeling I may have missed or misread something obvious, but I
> didn't find an answer to:
>
> What is the recommended way to create points (and dimensions)
> procedurally in the (kawa pictures) library?

Is there any problems with just using the &P[x y] and &D[w h] syntax?

The documentation should probably be clearer and show examples that x/y/w/h are
actually expressions - they don't have to be constant:
    
    &P[(sqrt 3) (+ 5 6)]

> By the way, I find the pictures library to be fun.  I especially like
> the SVG output feature.  Thanks for adding it (and for kawa)!

Great.  I've been thinking about extensions: Text, animations,
interactive widgets would all be cool, but all involve a number
of complicated issues, so they'll have to wait.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: (kawa pictures) procedural interface for point and dimension?
  2016-10-23 23:09 ` Per Bothner
@ 2016-10-23 23:54   ` Sudarshan S Chawathe
  2016-10-24 14:25   ` Sudarshan S Chawathe
  1 sibling, 0 replies; 4+ messages in thread
From: Sudarshan S Chawathe @ 2016-10-23 23:54 UTC (permalink / raw)
  To: Per Bothner; +Cc: kawa

> Is there any problems with just using the &P[x y] and &D[w h] syntax?

No; you are right!  It was a "duh" moment on my part.

Regards,

-chaw

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: (kawa pictures) procedural interface for point and dimension?
  2016-10-23 23:09 ` Per Bothner
  2016-10-23 23:54   ` Sudarshan S Chawathe
@ 2016-10-24 14:25   ` Sudarshan S Chawathe
  1 sibling, 0 replies; 4+ messages in thread
From: Sudarshan S Chawathe @ 2016-10-24 14:25 UTC (permalink / raw)
  To: Per Bothner; +Cc: kawa

This note is only a minor comment (perhaps too minor) on the
documentation/terminology.

> The documentation should probably be clearer and show examples that
> x/y/w/h are actually expressions - they don't have to be constant:
>     
>     &P[(sqrt 3) (+ 5 6)]

The above example would be a good aid to understanding.

On a related note, I think what caused my confusion was the tag
'Literal' next to the descriptions of &P and &D. That had me making an
analogy with string litrals, integer literals, etc. Of course, had I
read more carefully, I would have noticed the sentence right there
indicating that x and y are expressions that evaluate to integers (so my
earlier "duh" assessment of my confusion still stands).

I guess that leads to a question: Should &P (and &D) be described as
'syntax' instead of 'literal' (or am I confused again)?

Regards,

-chaw

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-10-24 14:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-23 22:23 (kawa pictures) procedural interface for point and dimension? Sudarshan S Chawathe
2016-10-23 23:09 ` Per Bothner
2016-10-23 23:54   ` Sudarshan S Chawathe
2016-10-24 14:25   ` Sudarshan S Chawathe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).