Jump to content
Developer Wiki and Function Reference Links ×

Overlapping perimeter of path objects


Hippocode

Recommended Posts

Trying to get a handle to the overlap of path based objects.

In particularly, the space object.

The code does work on a simple rectangle but doesn't on a space object.

Thus I added the GetCustomObjectPath hoping that would fix it.

Any suggestions ?

PROCEDURE intersect;
VAR
h1, h2, h3, h4 :HANDLE;
pt :VECTOR;
BEGIN
WHILE h1 = NIL DO BEGIN
	Message('Pick the first object...');
	GetPt(pt.x, pt.y);
	h1 := PickObject(pt.x, pt.y);
	h1 := GetCustomObjectPath(h1);
END;
WHILE h2 = NIL DO BEGIN
	Message('Pick the second object...');
	GetPt(pt.x, pt.y);
	h2 := PickObject(pt.x, pt.y);
	h2 := GetCustomObjectPath(h2);
END; 


h4 := IntersectSurface(h1, h2); { tried this, nothing }
{h4 := AddSurface(h1, h2);  tried this too, also nothing }


SetFPat(h4, 3);
ClrMessage;
END;
RUN(intersect);

Link to comment

Yup that worked, also had to play with the insertionpoints to get the duplicates on the right spot.

PROCEDURE intersect;
VAR
h1, h2, h3, h4 :HANDLE;
pt :VECTOR;
P1,P2,P3,P4 :POINT;
BEGIN
WHILE h1 = NIL DO BEGIN
	Message('Pick the first object...');
	GetPt(pt.x, pt.y);
	h1 := PickObject(pt.x, pt.y);
	GetSymLoc(h1,P1.x,P1.y);
	h1 := CreateDuplicateObject(GetCustomObjectPath(h1),NIL);
	GetSymLoc(h1,P3.x,P3.y);
END;
WHILE h2 = NIL DO BEGIN
	Message('Pick the second object...');
	GetPt(pt.x, pt.y);
	h2 := PickObject(pt.x, pt.y);
	GetSymLoc(h2,P2.x,P2.y);
	h2 := CreateDuplicateObject(GetCustomObjectPath(h2),NIL);
	GetSymLoc(h2,P4.x,P4.y);
END; 
	{ close the copy }
	SetPolyClosed(h1, True);
	SetPolyClosed(h2, True);

{ move them to the right spot  }
HMove(h1,P3.x+P1.x,P3.y+P1.y);
HMove(h2,P4.x+P2.x,P4.y+P2.y);

h4 := IntersectSurface(h1, h2);

SetFPat(h4, 3);
ClrMessage;
END;
RUN(intersect);

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...