I appears that a b-spline entity with 3 control points created by a D4D macro is not drawn correctly.
b-splines with 2 points or with 4 or more points are drawn correctly (as are 3 point b-splines created in the normal datacad interface).
But b-splines created with a D4D macro are drawn as a straight line between the 3rd control point and the origin as shown below:
The above was produced by the attached test macro with the source pasted below:
Am I doing something obviously wrong here ? The test macro was written after similar problems in a much more extensive macro I am working on (and it only occurs in that macro where there are 3 control points ... b-splines with 4 or more control points display just fine).
Any advice would be appreciated.
Thanks,
David H.
b-splines with 2 points or with 4 or more points are drawn correctly (as are 3 point b-splines created in the normal datacad interface).
But b-splines created with a D4D macro are drawn as a straight line between the 3rd control point and the origin as shown below:
The above was produced by the attached test macro with the source pasted below:
Code: Select all
library BspTest;
uses
System.sysutils,
UConstants in '../../Header Files/UConstants.pas',
UInterfaces in '../../Header Files/UInterfaces.pas',
UInterfacesRecords in '../../Header Files/UInterfacesRecords.pas',
URecords in '../../Header Files/URecords.pas',
UVariables in '../../Header Files/UVariables.pas';
{$E dmx} //dmx is the extension for DCAL Dll's
{$R *.res}
function BspTest_main(act : action; pl, pargs : Pointer) : wantType;
var
ent : entity;
begin
ent_init (ent, entbsp);
ent.bspbase := zbase;
ent.bsphite := zhite;
ent.bsppnt[1].x := -12288;
ent.bsppnt[1].y := 6144;
ent.bsppnt[1].z := zbase;
ent.bsppnt[2].x := -12288;
ent.bsppnt[2].y := 4992;
ent.bsppnt[2].z := zbase;
ent.bsppnt[3].x := -10920;
ent.bsppnt[3].y := 4992;
ent.bsppnt[3].z := zbase;
ent.bspnpnt := 3;
ent_add (ent);
ent_draw (ent, drmode_white);
Result := XDone;
end;
function Main(dcalstate : asint; act : action; pl, pargs : Pointer) : wantType; stdcall;
begin
case dcalstate of
XDcalStateBegin : Result := BspTest_main(act, pl, pargs);
else
Result := XDone;{Necessary}
end;
end;
exports
Main;
begin
end.
Am I doing something obviously wrong here ? The test macro was written after similar problems in a much more extensive macro I am working on (and it only occurs in that macro where there are 3 control points ... b-splines with 4 or more control points display just fine).
Any advice would be appreciated.
Thanks,
David H.
Attachments
(411.22 KiB) Downloaded 592 times
David Henderson
dhSoftware - Add-on Macros for DataCAD
dhSoftware - Add-on Macros for DataCAD