Recent

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

sin_dragan

  • Full Member
  • ***
  • Posts: 127
Re: CAD program written in Lazarus / FPC
« Reply #90 on: February 02, 2014, 09:47:03 pm »
Hi, first of all, let me say thank you for this great work.  :)

I tried to run the latest rev on my laptop Win7 64 with theme set to best performance and I get the blank work area (picture attached) when I switch to default Win7 theme then it's okay, anybode else have this behaviour?

Keep up the good work!
Windows 7 64 bit
Lazarus 1.4.1 (w/fixes) FPC 2.6.4 win32

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #91 on: February 03, 2014, 03:47:32 am »
Hi,
It seems that is not created OpenGL context. ZCAD uses TOpenGLContext component (slightly modified) from the Lazarus distr. Check as operating in this mode examples from lazarus\examples\openglcontrol\
Also please give values Render\(Device,Version,Vendor), as in screenshot, create drawing -> move the mouse -> right-click ->copy value

UPDATE:
Also I do not think that disabling themes give more performance, unfortunately integrated graphics has a very low performance when drawing a large number of lines, it is better to use a discrete graphics. Or need to write GDI+ render :(
« Last Edit: February 03, 2014, 08:39:15 am by zamtmn »

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: CAD program written in Lazarus / FPC
« Reply #92 on: February 03, 2014, 10:06:26 am »
Or need to write GDI+ render :(

OK. Give me an interface or abstract class to implement and I'll write you a GDI+ render-er.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #93 on: February 03, 2014, 12:53:02 pm »
taazz
While I have not delved into the particular GDI+, but I do not think that he will render difficult. The main problem to add 2D data, it need to calculate and store, calculate on the fly is slowly. My "abstract" rendering class copying Opengl structure, is a simple layer minimizing switching states, and operate on 3D data.
Please look at what works now: https://svn.shamangrad.ru/zcad/trunk/cad_source/misc/OGLSpecFunc.pas
Based on this need to develop a generic class.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: CAD program written in Lazarus / FPC
« Reply #94 on: February 03, 2014, 02:22:31 pm »
UPDATE:
Also I do not think that disabling themes give more performance,

It does on GDI on XP.   In later versions it doesn't matter so much, but turning off the settings in system -> "advanced settings" ->  performance -> "visual effects" still has quite some effect.
(my test was painting bitmaps btw, with a stretchdraw Metafile over it, I have no post Vista measurements, because in that time I changed it to opengl)


Quote
unfortunately integrated graphics has a very low performance when drawing a large number of lines, it is better to use a discrete graphics. Or need to write GDI+ render :(

With laptops that is hard. Specially because opengl is there often no option either, at least for showing bitmaps (till HD 4500, OpenGL misses non-poweroftwo textures)

sin_dragan

  • Full Member
  • ***
  • Posts: 127
Re: CAD program written in Lazarus / FPC
« Reply #95 on: February 03, 2014, 07:56:07 pm »
Hi, I tried on my work computer with best performance settings and it shows correctly, must be my laptop, I have an old X3100 Intel integrated card.
The value under Render on all is: OpenGL context is not created.

I use this to gain extra pixels because of my monitor being small :)
Windows 7 64 bit
Lazarus 1.4.1 (w/fixes) FPC 2.6.4 win32

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #96 on: February 04, 2014, 04:41:11 pm »
sin_dragan
Other OpenGL programs work normally? this problem occurs only in ZCAD?

CM630

  • Hero Member
  • *****
  • Posts: 1082
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: CAD program written in Lazarus / FPC
« Reply #97 on: February 20, 2014, 08:47:10 am »
Just a little recommendation- it would be better if you remove the recent files list from the distribution binaries.
BTW, заставка крутая!
« Last Edit: February 20, 2014, 08:49:34 am by paskal »
Лазар 3,2 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #98 on: February 20, 2014, 09:08:10 am »
paskal
For this there is a command Debug\**Utils\Clear file history. But all the time I forget to do it before publishing the binaries((

>>BTW, заставка крутая!
))

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #99 on: March 01, 2014, 10:14:17 pm »
New revision 893. Fixed some silly bugs with undo&object inspector

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #100 on: April 02, 2014, 08:29:24 pm »
Hi all!

New version (rev 900).
Some improvements in dxf load\save procedures. Fix some memory leaks.

jaky2551

  • New Member
  • *
  • Posts: 12
Re: CAD program written in Lazarus / FPC
« Reply #101 on: April 15, 2014, 05:04:07 am »
thank  :D  :D  :D
Lazarus 1.2.6, Firebird and ZeosDB from Thailand

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #102 on: April 20, 2014, 11:01:02 pm »
Hi all!

ZCAD has some initial capabilities for 3D drawing. On these animated gifs I tried to show the simple 3d figure creating and camera control

Creating simple 3d figure with object snap, polar tracing and direct length specify
http://i57.fastpic.ru/big/2014/0421/79/f40e7b2241e5f0e7edfe4ce6243e8a79.gif

Dimensions and move camera
http://i60.fastpic.ru/big/2014/0421/4e/c4a8b693e8ed17f69bcb9070e371ad4e.gif
« Last Edit: April 20, 2014, 11:03:10 pm by zamtmn »

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #103 on: April 22, 2014, 10:31:32 pm »
Hi all!

ZCAD supports drawing by grid. Although I do not consider this mode fit (object trace and object snap easier for me, so by default only they are), I implemented it. Screenshot much better than my poor English will explain how to turn on a grid - see attachment.
These settings are saved in the drawing and may be different in different drawings. The default settings are stored in the \template\default.dxf file

I am often asked about drawing by grid. To remove these questions I will answer here on the forum
« Last Edit: April 22, 2014, 10:36:44 pm by zamtmn »

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #104 on: May 26, 2014, 10:51:05 pm »
Hi all!

Another question I am often asked by people interested in zcad.
-On a very large drawings, graphics processing speed decreases. Is it possible to increase the speed?
I will answer here to avoid repetition.

Most often, the performance drop due to errors in the program. So drawing is better to send me to fix errors.

But if the speed limited by the number of entities in the drawing, there are ways to increase the speed by reducing the usability

1) parameter Render\Degradation while pan - If true, when you pan drawing, all  text\mtext entities simplistically drawn boundaries

2) parameter Render\Maximum single pass time - If not zero, it number in milliseconds spent on one rendering pass. that has not had time to finish will draw later in OnIdele handler. If zero (default) all been drawn in one pass

3) parameter Render\Image degradation - If enabled, some small details smaller than Current degradation factor are not drawn. if the Last render time is greater than Prefered rendering time then inc(Current degradation factor), else dec(Current degradation factor)
« Last Edit: May 27, 2014, 09:57:07 am by zamtmn »

 

TinyPortal © 2005-2018