gui\oglwindow.pas(4518,221) Error: Incompatible types: got "OGLSPECFUNC.TViewPortArray" expected "GLU.TViewPortArray"
{glu}TViewPortArray = array [0..3] of GLint;
in misc\OGLSpecFunc.pasGDBCommandsBase.pas(741,13) Error: identifier idents no member "AuxBuffers"Comment out the line causing them to
GDBCommandsBase.pas(742,13) Error: identifier idents no member "StencilBits"
GDBCommandsBase.pas(744,13) Error: identifier idents no member "DepthBits"
Сomment line 29Code: [Select]{glu}TViewPortArray = array [0..3] of GLint;
in misc\OGLSpecFunc.pas
In the FPC 2.6, this type is defined in glu.pp
zcad.pas(101,107) Error: Identifier not found "DefaultSystemCodePage"
zcad.pas(102,109) Error: Identifier not found "DefaultUnicodeCodePage"
zcad.pas(103,99) Error: Identifier not found "UTF8CompareLocale"
/BlueIcaro
This from fpc 2.7.1, comment out these linesThanks, I did it, and now I can compile the source. I going to explore your code, because I found it very interesting, the use that makes of OpenGl and import of cad files.
BlueIcaroYes I'm interest in this formats, I started to study the specifications, but I don't have time (I program Pc's for hobbie). Did you have some information/code, about this?
Yes, I would like it. But this is not such an important task for me. As long as I use to import the fpvectorial package, but the import procedure did not finish.
You have an interest in these formats?
Did you have some information/code, about this?No, I do not know these formats
/BLueIcaro
Hi All!Dear zamtmn your project is very good. I believe you will add a lot of tool in the future.
I compared a speed of displaying drawings in ZCAD vs LibreCAD. ZCAD much faster. Working with large drawings much more convenient.
But, unfortunately, a set of tools for working in ZCAD yet very small.
New version available sourceforge.net/projects/zcad/files - many small improvements
On the other side is not sophisticated 3D formats (not solid) can be fairly easy to add right now, but I do not have plan on this at the moment
I'm not familiar with the world of 3D printers, my interests lie more in the area of electrical engineering
And the best 3d printer comes from.. the Netherlands : Ultimaker.
https://www.ultimaker.com/ (https://www.ultimaker.com/)
@Fred vS
Unfortunately I have not a programmer, so the source code is not called many things by their right names. I also often "invent" some ways, and then learn from the books they have to look right.
No comments in the code, in the next few days I try to comment out the key points and to describe here on the forum, what is worth paying attention.
dxf2stl.py infile.dxf > outfile.stl
Can you attach here an example STL file?
As I understand it, they can be binary and text.
STL is not suitable for working with 3D objects, it is only good for the end result
In such kind is very easy to load. ZCAD has 3Dface entity, only need to convert triangles from file into 3DFace`s.
Import makes sense, at least to see the result.
procedure STLImport(filename:string);
begin
//read file and call
MaceTriangleInDrawing(x,y,z);//something like
end;
for export: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 commandsThese 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.
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
Or need to write GDI+ render :(
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 :(
TZGLOpenGLDrawer=class(TZGLAbstractDrawer)
public
procedure DrawLine(const i1:TLLVertexIndex);override;
procedure DrawPoint(const i:TLLVertexIndex);override;
end;
TZGLCanvasDrawer=class(TZGLAbstractDrawer)
public
canvas:tcanvas;
midline:integer;
procedure DrawLine(const i1:TLLVertexIndex);override;
procedure DrawPoint(const i:TLLVertexIndex);override;
end;
And did a little test. For canvas I got dismal results on small drawing (~31K lines)Hi all!
I think implement architecture shown in the screenshot.
Now all 3-level implemented in DXF entities, which makes them extremely difficult
procedure TForm1.GDIPlusPaint(Sender: TObject);
var
i:integer;
w,h:integer;
LPTime:Tdatetime;
graphicsGDIPlus:TGPGraphics;
pen: TGPPen;
begin
w:=TPanel(Sender).Width;
h:=TPanel(Sender).Height;
graphicsGDIPlus := TGPGraphics.Create(TPanel(Sender).canvas.Handle);
pen:= TGPPen.Create(MakeColor(255, 0, 0, 0), 1);
LPTime:=now();
for i:=0 to linescount do
begin
graphicsGDIPlus.DrawLine(Pen,random(w),random(h),random(w),random(h));
end;
lptime:=now()-LPTime;
Label2.Caption:='GDIPlus '+inttostr(round(lptime*10e7))+'msec';
pen.Free;
graphicsGDIPlus.Free;
end;
Test source and binary - http://sourceforge.net/projects/zcad/files/gditest.zip/download
It seems I understand what you're saying. You propose to do to me in addition OpenGLDrawer and GDIPlusDrawer, also CNCDrawer og GCodeDrawer. I guess it makes sense, but I am far from CNC, it should made a person interested in and knowledgeable in CNC. While I'm not willing to try to do
OK, I Part of this work I already done, look animated gif
http://i64.fastpic.ru/big/2014/0612/34/3d844e91105d7571b0a2deae5c85c534.gif
OpenGL driver info: NVIDIA Corporation GeForce GTX 460/PCIe/SSE2 2.1.2 NVIDIA 337.25
Draw 100000 random lines
Canvas: 149msec
GDIPlus not avialible
AGG: 7411msec
OpenGL: 1msec
OpenGL driver info: NVIDIA Corporation GeForce GTX 460/PCIe/SSE2 4.4.0 NVIDIA 337.25
Draw 100000 random lines
Canvas: 348msec
GDIPlus not avialible
AGG: 7201msec
OpenGL: 2msec
OpenGL driver info: NVIDIA Corporation GeForce GTX 460/PCI/SSE2 4.1.0
Draw 100000 random lines
Canvas: 135msec
GDIPlus: 5297msec
AGG: 7885msec
OpenGL: 6msec
...
var DrawInsidePaintMessage:boolean;
...
procedure WorkArea.Draw;
begin
//here render drawing to canvas code;
end;
...
procedure WorkArea.MyOnPaint
begin
self.Draw;
end;
...
procedure WorkArea.MyOnMouseMove
begin
DoSomething;
//Here i need to redraw WorkArea
if DrawInsidePaintMessage=true
then
self.Invalidate
else
self.draw;
end;
...
If i set DrawInsidePaintMessage to true - all drawn, double buffering work, but painting is not on every move the mouse, only when the mouse stopsHi all!
I'm updated a example of the use of the ZCAD engine http://svn.shamangrad.net/zcad/trunk/cad_source/simplecad/ It separate simplecad from "junk" zcad runtime files. Now it's just binary file and text file for color palette description (..\components\palette.rgb)
f:=pdwg^.GetUnitsFormat;
htext:=sysutils.Format('%s, %s, %s',[zeDimensionToString(param.md.mouse3dcoord.x,f),zeDimensionToString(param.md.mouse3dcoord.y,f),zeDimensionToString(param.md.mouse3dcoord.z,f)]);
if param.polarlinetrace = 1 then
begin
htext2:=sysutils.Format('L=%s',[zeDimensionToString(param.ontrackarray.otrackarray[param.pointnum].tmouse,f)]);
htext:=sysutils.Format('%s (%s)',[htext,htext2]);
getviewcontrol.Hint:=htext2;
Application.ActivateHint(getviewcontrol.ClientToScreen(Point(param.md.mouse.x,param.md.mouse.y)));
end;
type
RawByteString = type AnsiString(CP_NONE);
[Edit] I downloaded from svn @ http://svn.shamangrad.net/zcad/trunk/ and found the missing file; it just isn't @ http://svn.shamangrad.net/zcad/trunk/cad_source/simplecad/You need checkout all sources from svn.shamangrad.net/zcad/trunk/, simplecad is just a small part and it requires a lot of zcad files
New minor release 1375.Fix it in new 1445 release. Performance of ttf and shx fonts when using the gdi backend has increased
- GDI render backend can now display text entities (SHX and TTF) in the drawing.
Now you can draw using GDI instead of OpenGL, but on large drawings, the display speed will be significantly less
So there is no way to compile zcad with release fpc ?There are many minor inconsistencies, most of them are easily fixable. But I can't solve some problems with generics. With older releases of compilers (2.6.x) I get errors, for example:
Error: Incompatible types: got "TMap$QWord$ShortString$TLess$QWord.TSet$TPair$TMapCompare$TPair$TLess$QWord.PNode" expected "TMap$Pointer$QWord$TLess$Pointer.TSet$TPair$TMapCompare$TPair$TLess$Pointer.TSetIterator$TPair$Node.PNode"
I can fix all the minor incompatibilities, but for generics I need some help from people who understand this more. If there will be such people, then it is feasible.when opening the zcad.lpi all files in the except zcad.pas are striked out (not found).This is a consequence of the recent changes in the file structure of the project. I don't use that, so I don't notice it. Will fix soon.
Could you update the release.inc before the next commit (it was on 1386 and should have been at 1445)Normal content of this file "const RevisionStr = 'Unknown';". I enter the version number there only for publication. But sometimes I forget it, and commit these changes. Will fix soon.
function SetGraphicsMode(hdc:HDC; iMode:longint):longint; external 'gdi32' name 'SetGraphicsMode';
function SetWorldTransform(_para1:HDC; var _para2:XFORM):WINBOOL; external 'gdi32' name 'SetWorldTransform';
function ModifyWorldTransform(_para1:HDC; var _para2:XFORM; _para3:DWORD):WINBOOL; external 'gdi32' name 'ModifyWorldTransform';
Most people think that it is something complex and specificFor me . I try to understand the program programmatically to add features .I could not build it on Linux
Need trunk Lazarus and 3.0 or trunk FPC. I've been wanting to stop and maintain compatibility with the stable release, but always something is missing.Good thing you are put cad_source/simplecad/
what interests you?A lot of things . Calculate area .Advanced print settings like autocad
I think that's right. This is the only way to make fast graphics.Exactly .. and will help developers to access the raw data to making addons or functions
@Edson
Why parts of the project are divided ?? each components have repositorie !!
DefObjGraf.pas(53,31) Error: Identifier not found "TMotPoint"
Edson
EvalExpres.pas double in Graficador-de-Funciones-3D and TitoCad
and cant compileQuoteDefObjGraf.pas(53,31) Error: Identifier not found "TMotPoint"
I failed to compile TitiCad. But I looked at the published binary. A lot of work has been done, it's very cool.Thanks. Most of the work is done by the libraries. I can prepare a full version of the source, including the libraries, if you need.
But there are still a lot of problems, obvious and not. In zcad some of them are already solved.Yes. A lot of problem. Actually TitoCad was more an experiment to test some libraries I made. My first need was to have a graphic library to some SQL editor and other programs. Then I ported a 3D editor library I made for a VB software (a long time ago) and used it as a 2D interfaz. Having a 3D library I decided to test in some 3D editor and TitoCad is the result and it's far from to be complete.
Why do the same thing? we need to uniteGood. I think we can start sharing some modules or libraries to reuse the code and see if finally they can be unified.
>>A lot of things . Calculate area .Advanced print settings like autocad
If you want, you can join, and realize your interests
Opengl and gdi - full work drawers, canvas - only for printing and draw on GUI (preview and etc.) Also necessary to make DX backend.I will revise the code and I'll give my opinion. Do you have some documentation? Can it be compiled with Lazarus 1.8?
I try to make zсad from as much as possible independent parts. Can be identified the following parts:
-gui
-object inspector (although this is part of the gui, but the complexity of it deserves a separate punkt)
-commands
-dxf styles
-dxf entities and drawings
-dxf entities extenders
-drawers and low level graphix entities
Edson
I seem ..it is an electronic program (I Deduced from [/size]selection type)
I've separate clean CAD. But so far I haven't done the automatic generation of the environment, form it into manual modeNow I've written scripts to generate the environment. Run zcad.{bat|sh} or zcadelectrotech.{bat|sh} before compiling
benohb1 monochrome mode - without intervention in the engine not to do, so will do it myself
Apparently my code is not perceived by other people((
I have some suggestions for the printing system:
1 monochrome mode
2 preview
I will be glad of any help.
zcad print "command": https://github.com/zamtmn/zcad/blob/master/cad_source/zcad/commands/uzccommand_print.pas
zamtmm, just a suggestion.http://wiki.freepascal.org/Projects_using_Lazarus#ZCAD
Your git page includes a simple wiki. Dead easy to put some pictures of your app in there. They say a picture is worth a thousand words, I'd suggest in the case of a CAD program its even more than that !
Show us what it can do !
Davo
how long did it take you ?
I have done a lot of architectural drawing for a house I built using Inkscape. Inkscape is really not a suitable tool for that purpose (more intended for artistic work and I'm no artist !) ...
And getting back to the architectural, dimensions are very important. Do you 'scale' your drawings ...
Zamtmm, can you tell me what you mean by "electrotech" ?I'm an electrical engineer and I use ZCAD in work. So there are some highly specialized things.
Can your drawings work with a 'library' of components ? For example, in drawing up electronic circuit diagrams you like to have a pile of predrawn electronic components on hand and drag then onto the drawing. In many cases, lots and lots of times.Yes.
And getting back to the architectural, dimensions are very important. Do you 'scale' your drawings so, as I add features, I can determine how big they are ? eg, I want to put a wall in, and I know its 6m long, can I easily draw a (scaled) 6m wall ?ZCAD supports some dimensional primitives and dimension styles. LibreCAD by the way does not support dimension styles, so it has a limitation: one drawing = one scale
I found a bug when using ZCAD. The mirror tool didn't mirror arc correctly.
Hi all!pretty great project! some people say pascal is dead, but here you are making advanced programs, multiplatform, and native, what a great language!
New release https://github.com/zamtmn/zcad/releases/tag/0.9.8.4
What is DXF and DWG version supports?dxf2000. I can add newer versions of dxf. But without the implementation of new primitives and opportunities, it is only a formality
pretty great project!Thanks!
Thanks. please attach sample
Most likely shx fonts from zcad do not contain the necessary characters
Is run cad on Mac OSX?I try on VM, zcad works, but buggy((
Thanks
Maybe we can join forces!