Use
our MNHiddenLines to let hidden lines be computed completly
mathematical based. Control any plotter or industrial cutter
- whatever device which has to be feed with vector data (NOT
WITH BITMAP DATA) can be controlled easily. For fast screen
output you can use our OpenGL based hidden buffer.
Features:
available
as windows dll file (MNHL.DLL - API calls) and ActiveX component
- developement system independent
completly math based
easy
to use (a lot of samples for demonstration of "how to
use")
define
your own Projection- and Distancefunctions or use the defaults
define
your own MoveTo- and LineTo Events (easy integration into
your existing canvas applications)
comfortable
methods to add data to the hiddenlines buffer (MNSDAddContour,
MNSDAddHole) - bypass a proper hiddenlines buffer (generated
via MNSDOpen) and an array or 3D points
Comfortable
methods to operate on the calculated polygons in 3D (MNSDXYZListCount,
MNSDXYZList), in 2D (MNSDXYListCount, MNSDXYList) and on masked
lines (MNSDGetMaskCount, MNSDMask)
use
multiple hiddenlines buffer at the same time (use it for different
layers or different views)
...
Take a look at the following example:
First
create a hidden line handle:
procedure TForm1.FormCreate(Sender: TObject);
begin
HiddenBuffer:=MNSDOpen (NormalProjection, NormalDistance, MyLineto,
MyMoveto);
end;
Add
contours and holes to the hidden line handle:
MNSDContour (HiddenBuffer,
[XYZ(0.00,0.00,0.00),
XYZ(0.00,2.00,0.00),
XYZ(2.00,2.00,0.00),
XYZ(2.00,0.00,0.00),
XYZ(0.00,0.00,0.00) ]);
...
MNSDHole (HiddenBuffer,
[XYZ (0.67,0.67,0.00),
XYZ (1.33,0.67,0.00),
XYZ (1.33,1.33,0.00),
XYZ (0.67,1.33,0.00),
XYZ (0.67,0.67,0.00) ]);
...
Paint
data from hidden line handle:
procedure
TForm1.FormPaint (Sender: TObject);
begin
MNSDdraw(HiddenBuffer);
end;
const unitspercm=47; // define a scale
Define
your own draw mechanisms: Procedure MyMoveto (H:THHandle; P:TXY);
var xi,yi:integer;
BEGIN
With Form1.Canvas do BEGIN
Xi:=round(P.x*unitspercm +Form1.width div 2);
Yi:=round(-P.y*unitspercm+Form1.height div 2);
MoveTo(xi,yi);
END;
END;
procedure MyLineto(H:THHandle; Down: Boolean; P:Txy);
var Xi,Yi:integer;
begin
With Form1.canvas do BEGIN
Xi:=round(P.x*unitspercm +Form1.width div 2);
Yi:=round(-P.y*unitspercm+Form1.height div 2);
If Not Down then Pen.style:=Psdot ELSE Pen.style:=PsSolid;
Lineto(xi,yi);
END;
end;
At
the end destroy the hidden line handle:
procedure
TForm1.FormDestroy(Sender: TObject);
begin
MNSDFree (HiddenBuffer);
end;
You
can use the same handling to control the OpenGL buffer, with
the difference that you will have faster screen output but no
mathematical based hidden line calculations.