[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

looking for a geometry library

Mirko

5/18/2015 2:27:00 PM

I looked on cliki, but nothing jumped out.

I need to manipulate points and paths:

Points are 2D or 3D. I want to scale them with respect to a reference point, translate them, etc.

Paths consist of straight line segments and which are ordered collections of points. I will want to apply affine transformations to them.

(I am not thinking of Bezier curves).

I already have written bits that I need, but why continue, if there is a tested library?

Oh, and one more thing: it has to be in Common Lisp.

Thanks,

Mirko

10 Answers

Pascal J. Bourguignon

5/18/2015 5:16:00 PM

0

Mirko Vukovic <mirko.vukovic@gmail.com> writes:

> I looked on cliki, but nothing jumped out.
>
> I need to manipulate points and paths:
>
> Points are 2D or 3D. I want to scale them with respect to a reference point, translate them, etc.
>
> Paths consist of straight line segments and which are ordered
> collections of points. I will want to apply affine transformations to
> them.
>
> (I am not thinking of Bezier curves).
>
> I already have written bits that I need, but why continue, if there is a tested library?
>
> Oh, and one more thing: it has to be in Common Lisp.

There are several graphic libraries that have that.
There's nothing generic, because, there are a lot of implementation
choices that are driven by external choices.

Shall points be integer (for a fixed resolution bitmap model, that would
be enough) or floats? Single or double float?
Implemented as structures, vectors, complexes?
Mutable or immutable? And from there on.

You may find one model in
https://gitlab.com/patchwork/mclgui/t...
(quickdraw model).

You will find other models in:
http://cli...
http://cliki.net/Graphics...
yes, most of them are FFIs to C or C++ implementations, but there are
also pure CL ones, like eg. McCLIM and cl-vectors.

--
__Pascal Bourguignon__ http://www.informat...
â??The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.� -- Carl Bass CEO Autodesk

Madhu

5/19/2015 1:09:00 AM

0



* Mirko Vukovic <b7b48f35-f5b0-47c8-b313-40658c7034f3@googlegroups.com> :
Wrote on Mon, 18 May 2015 07:26:52 -0700 (PDT):

| I looked on cliki, but nothing jumped out.
|
| I need to manipulate points and paths:
|
| Points are 2D or 3D. I want to scale them with respect to a reference
| point, translate them, etc.
|
| Paths consist of straight line segments and which are ordered
| collections of points. I will want to apply affine transformations to
| them.
|
| I already have written bits that I need, but why continue, if there is
| a tested library?

Grapics Ports is probably the nicest "available" APIs that I've seen in
CL, but it depends on your ability to use lispworks:

<http://www.lispworks.com/documentation/lw61/CAPRM/html/capiref-4...
<http://www.lispworks.com/documentation/lw61/CAPUG-W/html/capiuser-w-1...

--- Madhu

Jeff Barnett

5/19/2015 4:17:00 AM

0

Mirko Vukovic wrote on 5/18/2015 8:26 AM:
> I looked on cliki, but nothing jumped out.
>
> I need to manipulate points and paths:
>
> Points are 2D or 3D. I want to scale them with respect to a reference point, translate them, etc.
>
> Paths consist of straight line segments and which are ordered collections of points. I will want to apply affine transformations to them.
>
> (I am not thinking of Bezier curves).
>
> I already have written bits that I need, but why continue, if there is a tested library?
>
> Oh, and one more thing: it has to be in Common Lisp.
>
> Thanks,
>
> Mirko

I'm not sure how much stuff you need but the Lisp machines and many
subsequent developments had all the coordinate transformation stuff you
could imagine as part of the graphics object hierarchy. Of course that
is all 2D. No suggestions of where to look for 3D routines.
--
Jeff Barnett

Marco Antoniotti

5/19/2015 8:39:00 AM

0

On Tuesday, May 19, 2015 at 3:08:45 AM UTC+2, Madhu wrote:
> * Mirko Vukovic <b7b48f35-f5b0-47c8-b313-40658c7034f3@googlegroups.com> :
> Wrote on Mon, 18 May 2015 07:26:52 -0700 (PDT):
>
> | I looked on cliki, but nothing jumped out.
> |
> | I need to manipulate points and paths:
> |
> | Points are 2D or 3D. I want to scale them with respect to a reference
> | point, translate them, etc.
> |
> | Paths consist of straight line segments and which are ordered
> | collections of points. I will want to apply affine transformations to
> | them.
> |
> | I already have written bits that I need, but why continue, if there is
> | a tested library?
>
> Grapics Ports is probably the nicest "available" APIs that I've seen in
> CL, but it depends on your ability to use lispworks:
>
> <http://www.lispworks.com/documentation/lw61/CAPRM/html/capiref-4...
> <http://www.lispworks.com/documentation/lw61/CAPUG-W/html/capiuser-w-1...
>
> --- Madhu

I second that. I just liked some more in-depth tutorials about it.

MA

convert lisp to c++

5/19/2015 12:21:00 PM

0

Hi,
You can transform C++ function to C++Lisp and library.
If you compile pp_topoglist.cpp , the you got pp_topolist.lsp
The file pp_topoglist.cpp, contain 983 functions C++ and autolisp..
You downloading full source for autolisp
http://www.puiubrat.3x.ro/adve2013/bta_mylispport...

You found the homepage.txt inside bta_mylispportofolio.zip, for
downloading the compilator from (windowsXP+,win7,win8), portabile
version, for LiveCD-iso.LiveDVD-iso,from homepage.txt
=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=



luni, 18 mai 2015, 07:26:56 UTC-7, Mirko Vukovic a scris:
> I looked on cliki, but nothing jumped out.
>
> I need to manipulate points and paths:
>
> Points are 2D or 3D. I want to scale them with respect to a reference point, translate them, etc.
>
> Paths consist of straight line segments and which are ordered collections of points. I will want to apply affine transformations to them.
>
> (I am not thinking of Bezier curves).
>
> I already have written bits that I need, but why continue, if there is a tested library?
>
> Oh, and one more thing: it has to be in Common Lisp.
>
> Thanks,
>
> Mirko

Mirko

5/19/2015 2:29:00 PM

0

On Monday, May 18, 2015 at 1:25:23 PM UTC-4, informatimago wrote:
> Mirko Vukovic <mirko.vukovic@gmail.com> writes:
>
> > I looked on cliki, but nothing jumped out.
> >
> > I need to manipulate points and paths:
> >
> > Points are 2D or 3D. I want to scale them with respect to a reference point, translate them, etc.
> >
> > Paths consist of straight line segments and which are ordered
> > collections of points. I will want to apply affine transformations to
> > them.
> >
> > (I am not thinking of Bezier curves).
> >
> > I already have written bits that I need, but why continue, if there is a tested library?
> >
> > Oh, and one more thing: it has to be in Common Lisp.
>
> There are several graphic libraries that have that.
> There's nothing generic, because, there are a lot of implementation
> choices that are driven by external choices.
>
> Shall points be integer (for a fixed resolution bitmap model, that would
> be enough) or floats? Single or double float?
> Implemented as structures, vectors, complexes?
> Mutable or immutable? And from there on.
>

Very good points (opportunity for self-referential jokes
here). I was considering integers (as I believe
TeX and MetaFont use), or rationals (cl-geometry
https://github.com/Ramarren/c...).


> You may find one model in
> https://gitlab.com/patchwork/mclgui/t...
> (quickdraw model).
>
> You will find other models in:
> http://cli...
> http://cliki.net/Graphics...
> yes, most of them are FFIs to C or C++ implementations, but there are
> also pure CL ones, like eg. McCLIM and cl-vectors.

cl-vectors - I may I use its PATH package.

Thanks to all who replied

luserXtrog

5/20/2015 7:07:00 AM

0

On Monday, May 18, 2015 at 9:26:56 AM UTC-5, Mirko Vukovic wrote:
> I looked on cliki, but nothing jumped out.
>
> I need to manipulate points and paths:
>
> Points are 2D or 3D. I want to scale them with respect to a reference point, translate them, etc.
>
> Paths consist of straight line segments and which are ordered collections of points. I will want to apply affine transformations to them.
>
> (I am not thinking of Bezier curves).
>
> I already have written bits that I need, but why continue, if there is a tested library?
>
> Oh, and one more thing: it has to be in Common Lisp.
>

This may not fit your bill (probably not, as you
explicitly say CL), but I am the prophet of PostScript.
A language designed specifically for all the things
you say (and Beziers too).

Most Lispers surely know that Postscript shares many
delightful properties like (mostly) transparent
syntax -> data structure encoding == program.
You can manipulate (mutilate) procedure bodies
to your heart's content because all the pieces
are concatenative -- iff you mind what you're doing
to the stack.

Pro:
Postscript has points and paths
and affine transformations
and Beziers
and many Lisp-like powers

Con:
It's not CL
It's not even Lisp, really. It's very different in
many ways.

If anyone's still reading this, I've curated
links to tutorials, manuals, and faqs here:
http://stackoverflow.com/tags/posts...

And help is just nextdoor:
https://groups.google.c...!forum/comp.lang.postscript

luserXtrog

5/20/2015 7:17:00 AM

0

On Wednesday, May 20, 2015 at 2:07:28 AM UTC-5, luserdroog wrote:
>
> Most Lispers surely know that Postscript shares many
> delightful properties like (mostly) transparent
> syntax -> data structure encoding == program.
> You can manipulate (mutilate) procedure bodies
> to your heart's content because all the pieces
> are concatenative -- iff you mind what you're doing
> to the stack.

"case study" in point:
http://codereview.stackexchange.com/questions/12249/concatenative-postscript-library/6...

[snip]
>
> If anyone's still reading this, I've curated
> links to tutorials, manuals, and faqs here:
> http://stackoverflow.com/tags/posts...
>
> And help is just nextdoor:
> https://groups.google.c...!forum/comp.lang.postscript

luserXtrog

5/20/2015 8:29:00 AM

0

On Wednesday, May 20, 2015 at 2:07:28 AM UTC-5, luserdroog wrote:
> On Monday, May 18, 2015 at 9:26:56 AM UTC-5, Mirko Vukovic wrote:
> > I looked on cliki, but nothing jumped out.
> >
> > I need to manipulate points and paths:
> >
> > Points are 2D or 3D. I want to scale them with respect to a reference point, translate them, etc.
> >
> > Paths consist of straight line segments and which are ordered collections of points. I will want to apply affine transformations to them.
> >
> > (I am not thinking of Bezier curves).
> >
> > I already have written bits that I need, but why continue, if there is a tested library?
> >
> > Oh, and one more thing: it has to be in Common Lisp.
> >
>
> This may not fit your bill (probably not, as you
> explicitly say CL), but I am the prophet of PostScript.
> A language designed specifically for all the things
> you say (and Beziers too).
>

I've got an example of Bezier interpolation to
plot a differentiable function here:
http://tex.stackexchange.com/a/10...

--
and I think I'm done. back to yerbiz

Kaz Kylheku

5/20/2015 2:29:00 PM

0

On 2015-05-20, luserdroog <mijoryx@yahoo.com> wrote:
> On Monday, May 18, 2015 at 9:26:56 AM UTC-5, Mirko Vukovic wrote:
>> I looked on cliki, but nothing jumped out.
>>
>> I need to manipulate points and paths:
>>
>> Points are 2D or 3D. I want to scale them with respect to a reference point, translate them, etc.
>>
>> Paths consist of straight line segments and which are ordered collections of points. I will want to apply affine transformations to them.
>>
>> (I am not thinking of Bezier curves).
>>
>> I already have written bits that I need, but why continue, if there is a tested library?
>>
>> Oh, and one more thing: it has to be in Common Lisp.
>>
>
> This may not fit your bill (probably not, as you
> explicitly say CL), but I am the prophet of PostScript.
> A language designed specifically for all the things
> you say (and Beziers too).
>
> Most Lispers surely know that Postscript shares many
> delightful properties like (mostly) transparent
> syntax -> data structure encoding == program.
> You can manipulate (mutilate) procedure bodies
> to your heart's content because all the pieces
> are concatenative -- iff you mind what you're doing
> to the stack.

The pieces being catenative has little to with the pieces being
a structured, nested tree, as it is in Lisp.

In Lisp, we do not manipulate procedure bodies once they are compiled.
They become native machine code, or byte code for a virtual machine.
Code isn't data; rather, *source* code is data.

> and many Lisp-like powers

Chopping up sausages of instructions that implicitly refer to arguments
by stack position is a far cry from "Lisp-like powers".

That is not even safe to do, because it can result in stack underflows;
the pieces cannot be arbitrarily rearranged.

It may look like the syntax is just a clump of words ("there is no syntax"),
but that is a lie. What looks like a linear sequence

a b c d e f g

could in fact have the structure (for example)

(a b c d) (e f) g

that is to say, g is binary, and its operands are produced by the two
chains a b c d and e f .

We don't know any of this by just looking at it. We don't know g is binary. We
don't know how the chain breaks up to produce arguments for g. We don't know
how many arguments the whole thing takes, and what it puts on the stack.

These considerations amount to syntax, just like taking a seven word
sentence and identifying the subject, object, verb and finer structures.

The above structure, if it is true, tells me that, for instance,
I shouldn't be transforming the code by moving around (d e).
Words d and e belong to separate logical structures; they do not
constitute a unit.