The DataCAD Developer Network (DDN) is an online resource for information and support for DCAL® (DataCAD Applications Language) developers as well as anyone interested in creating fonts, toolbars, hatch patterns, or linetypes for use in DataCAD.

Moderator: pjdixit

#75929 by dhs
Sat Mar 09, 2019 2:28 pm
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:Image
The above was produced by the attached test macro with the source pasted below:
Code: Select alllibrary 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 2 times
#75930 by dhs
Sat Mar 09, 2019 3:02 pm
it's not just a D4D problem ... same thing happens in the following Classic DCAL test macro:
Code: Select allPROGRAM bsptest;

VAR
   ent : entity;

BEGIN
   ent_init (ent, entbsp);
   ent.bspbase := zbase;
   ent.bsphite := zhite;
   ent.bsppnt[1].x := -2288.0;
   ent.bsppnt[1].y := 4144.0;
   ent.bsppnt[1].z := zbase;
   ent.bsppnt[2].x := -2288.0;
   ent.bsppnt[2].y := 2992.0;
   ent.bsppnt[2].z := zbase;
   ent.bsppnt[3].x := -920.0;
   ent.bsppnt[3].y := 2992.0;
   ent.bsppnt[3].z := zbase;
   ent.bspnpnt := 3;
   ent_add (ent);
   ent_draw (ent, drmode_white);
END bsptest.

Who is online

Users browsing this forum: No registered users and 2 guests

About DataCAD Forum

The DataCAD Forum is a FREE online community we provide to enhance your experience with DataCAD.

We hope you'll visit often to get answers, share ideas, and interact with other DataCAD users around the world.

DataCAD

Software for AEC Professionals Since 1984