Recent

Author Topic: CAD program written in Lazarus / FPC  (Read 190066 times)

Fred vS

  • Hero Member
  • *****
  • Posts: 3168
    • StrumPract is the musicians best friend
Re: CAD program written in Lazarus / FPC
« Reply #75 on: November 08, 2013, 06:33:02 pm »
Hello.

Here a ascii <> Binary STL converter. Free and open-source given by MakerBot :

https://www.thingiverse.com/thing:39655

It is in ruby code.

I gonna try it to translate the binary stl i give before.
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3168
    • StrumPract is the musicians best friend
Re: CAD program written in Lazarus / FPC
« Reply #76 on: November 08, 2013, 07:35:14 pm »
Hello.

Here the ascii stl file...

PS : Ruby code is not so far than Pascal, so very easy to translate into Pascal.  ;)
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #77 on: November 08, 2013, 07:50:24 pm »
@Fred vS
In such kind is very easy to load. ZCAD has 3Dface entity, only need to convert triangles from file into 3DFace`s.
But it has no practical value in my opinion, STL is not suitable for working with 3D objects, it is only good for the end result

Fred vS

  • Hero Member
  • *****
  • Posts: 3168
    • StrumPract is the musicians best friend
Re: CAD program written in Lazarus / FPC
« Reply #78 on: November 08, 2013, 09:45:14 pm »
Quote
STL is not suitable for working with 3D objects, it is only good for the end result

Totally agree, STL is a end-ready-to-use file for stereo-lithographic machines.
Not really a "working-edit" file. (maybe it was the goal of that kind of file, a "protected" 3d file, good for designers of the 3d objects).

Quote
In such kind is very easy to load. ZCAD has 3Dface entity, only need to convert triangles from file into 3DFace`s.

So, good news, zcad is ready for the 3d revolution, only need a "export to stl"  ( "import from stl" has no sense ).  ;)
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #79 on: November 08, 2013, 10:13:42 pm »
Import makes sense, at least to see the result.
For internal use more suitable something using NURBS surfaces - compact and editable

Fred vS

  • Hero Member
  • *****
  • Posts: 3168
    • StrumPract is the musicians best friend
Re: CAD program written in Lazarus / FPC
« Reply #80 on: November 08, 2013, 10:28:05 pm »
Quote
Import makes sense, at least to see the result.

Yes, but if the conversion is ok, the result is the same as the zcad file.
Of course "Import STL" is a plus.

PS : LibreCad do export to STL but do not import from STL.
        SketchUp do export to STL (via plugin) but do not import from STL.
        FreeCad do export to STL and do import from STL.         
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #81 on: November 08, 2013, 10:58:45 pm »
If you want, I can make the blank to the following procedures. something like
to import:
Code: [Select]
procedure STLImport(filename:string);
begin
       //read file and call
       MaceTriangleInDrawing(x,y,z);//something like
end;
for export:
Code: [Select]
procedure STLExportHeader(filename:string);
begin
       //write header
end;
procedure STLExportTriangle(x,y,z:double);//it will be called for each triangle in the drawing
begin
       //write triangles
end;
procedure STLExportEnd;
begin
       //write footer
end;
These procedures will be available from the zcad interface as import and export commands
Implementation of the file format I will not yet engaged. better I'll improve 3DFace, and maybe start implement the NURBS surfaces.

Fred vS

  • Hero Member
  • *****
  • Posts: 3168
    • StrumPract is the musicians best friend
Re: CAD program written in Lazarus / FPC
« Reply #82 on: November 08, 2013, 11:03:37 pm »
Quote
These procedures will be available from the zcad interface as import and export commands
Implementation of the file format I will not yet engaged. better I'll improve 3DFace, and maybe start implement the NURBS surfaces.

Ok, perfect and... take your time, be cool, nothing is burning... ;)
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #83 on: December 01, 2013, 11:08:44 pm »
Hi all!

I simplified and commented out the drawing commands interface. If earlier these commands represent themselves classes with methods OnMouseMove like, now they are flat procedures.
Part responsible for event handling is moved to the simple procedure Get3DPoint.
Structure greatly simplified and is now similar to
Code: [Select]
Procedure DrawLine;
...
p1=GetPoint();
p2=GetPoint();
CreateLine(p1,p2);
...
Example commands for drawing aligned dimension you can see here http://svn.shamangrad.net/zcad/trunk/cad_source/commands/gdbcommandsexample.pas , the result of a command in the attached animated gif

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #84 on: December 11, 2013, 11:38:20 am »
Hi all!

I implemented a simple dimensional primitives (linear, aligned, radius, diameter), now in ZCAD you can fully draft a simple drawings

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #85 on: January 08, 2014, 09:23:24 pm »
Hi all!

New version (rev 856). Many small improvements and enhancements object inspector. Now it can display graphics and buttons

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: CAD program written in Lazarus / FPC
« Reply #86 on: January 09, 2014, 10:37:35 am »
Impressive-looking screenshot, zamtmn, thanks a lot for your hard work and generosity!
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #87 on: January 21, 2014, 08:38:33 pm »
BigChimp
Thank you!

All
Project need help in the form of writing some GUI windows

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #88 on: January 28, 2014, 08:46:20 am »
Hi all!

New build for linux (rev 860) - fix focus handling with qt widgeset
« Last Edit: February 02, 2014, 05:20:26 pm by zamtmn »

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #89 on: February 02, 2014, 05:19:52 pm »
Hi all!

Object Inspector learned to use undo-redo stack (rev 877). Now entity changes through the inspector you can undo

 

TinyPortal © 2005-2018