Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-04

Vector graphics

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Koenraad Lelong

Hi,

I would like to try to make a CAD-file viewer. More specific to view the contents of a GenCAD-file. That's an ascii-file containing a description of a PCB. It's an hierarchy of graphical entities. So I would need some drawing routines, eventually with filled surfaces i.e. filled circles, rectangles but also rectangles with rounded corners, etc.
What could I use ? I tried compiling fpvectorial on lazarus 0.9.30.4, but it needs fcl version 1.01. I think that's from a newer version of fpc than 2.6.0 I'm using.

Any advise ?

Thanks,

Koenraad Lelong.

Reply by email

Felipe Monteiro de Carvalho
to Koenraad Lelong
Koenraad Lelong wrote 5 lines
So I would need some drawing routines, eventually with filled surfaces i.e. filled circles, rectangles but also rectangles with rounded corners, etc. What could I use ? I tried compiling fpvectorial on lazarus 0.9.30.4, but it needs fcl version 1.01. I think that's from a newer version of fpc than 2.6.0 I'm using.

I think it should work fine in Lazarus 0.9.30, just edit the dependency. fpvectorial is mostly independent from Lazarus, only the 2D drawing output uses the LCL.

fpvectorial does not depend on having a new FPC. I recommend using the latest svn of fpvectorial which is in the lazarus trunk.

Of course I highly recommend using fpvectorial for you task, I can offer you tips as to how to add support for the file format you are working with, and as a bonus you get support for all formats already supported by fpvectorial.

If you have trouble setting up the necessary things you could try a snapshot of Lazarus trunk.

Felipe Monteiro de Carvalho

Reply by email

Koenraad Lelong
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote 23 lines
On Fri, Apr 6, 2012 at 3:02 PM, Koenraad Lelong wrote: > So I would need some drawing routines, eventually with filled surfaces i.e. > filled circles, rectangles but also rectangles with rounded corners, etc. > What could I use ? I tried compiling fpvectorial on lazarus 0.9.30.4, but it > needs fcl version 1.01. I think that's from a newer version of fpc than > 2.6.0 I'm using. I think it should work fine in Lazarus 0.9.30, just edit the dependency. fpvectorial is mostly independent from Lazarus, only the 2D drawing output uses the LCL. fpvectorial does not depend on having a new FPC. I recommend using the latest svn of fpvectorial which is in the lazarus trunk. Of course I highly recommend using fpvectorial for you task, I can offer you tips as to how to add support for the file format you are working with, and as a bonus you get support for all formats already supported by fpvectorial. If you have trouble setting up the necessary things you could try a snapshot of Lazarus trunk.

Hi Felipe,

Thanks for your response.
Just to report my experience :

I downloaded the package via svn.
First I modified the fcl-version needed. Then I had to remove a unit (rawvectorialreadwrite.pas) from the package before I could compile it. I don't remember the error but it was on the line containing lRawImage.Description.Init_BPP24_R8G8B8_BIO_TTB(RAW_IMAGE_WIDTH, RAW_IMAGE_HEIGHT);

Then, unfortunately, none of the examples seem to work. Only two I could compile : fpcorelexplorer, but when I run it, it gives a "list index out of bounds" error after selecting a coreldraw 9 file. Then it gives correctly the version of the coreldraw used, but no size. I don't know what it's supposed to do more.
fpvectorialconverter gives an "unsupported vector graphics format" error when I select a pdf and click to visualise it.

fpv3dviewer gives "identifier not found" on RequireDerivedFromResource. fpvmodifytest and fpvwritetest give errors on a bunch of "WSRegister..." statements.

That's all with the latest release version of lazarus/fpc, on Windows 7. I'll have to see if I can get a working lazarus from svn.

Regards,

Koenraad Lelong.

Reply by email

Felipe Monteiro de Carvalho
to Koenraad Lelong
(rawvectorialreadwrite.pas) from the package before I could compile it. I don't remember the error but it was on the line containing lRawImage.Description.Init_BPP24_R8G8B8_BIO_TTB(RAW_IMAGE_WIDTH, RAW_IMAGE_HEIGHT);

This is a new routine from the LCL in 0.9.31+

Then, unfortunately, none of the examples seem to work. Only two I could compile : fpcorelexplorer, but when I run it, it gives a "list index out of bounds" error after selecting a coreldraw 9 file. Then it gives correctly the version of the coreldraw used, but no size. I don't know what it's supposed to do more.

The corel explorer is only for low level studying of the Corel format. It does not do much, it was never finished and you should not use it unless you are developing the corel importer/exporter unit.

fpvectorialconverter gives an "unsupported vector graphics format" error when I select a pdf and click to visualise it.

The PDF reader was not written by me and the code was unmaintainable so when I did some big changes in fpvectorial it was disabled. It is a ToDo to rehabilitate it (patches are welcome!), although I think that we should start it from zero again using the new PostScript interpreter which exists now in fpvectorial.

Try other formats. For any error about unsupported format check if the project adds in the uses clause the appropriate unit for reading or writing the format.

fpv3dviewer gives "identifier not found" on RequireDerivedFromResource.

This is a new routine from the LCL in 0.9.31+
Just delete it.

fpvmodifytest and fpvwritetest give errors on a bunch of "WSRegister..." statements.

wierd.

That's all with the latest release version of lazarus/fpc, on Windows 7. I'll have to see if I can get a working lazarus from svn.

Yes, that would be the best. 0.9.30 is too far behind the current Lazarus Trunk.

Felipe

Felipe Monteiro de Carvalho

Reply by email