Hippocode Posted November 22, 2012 Share Posted November 22, 2012 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); Quote Link to comment
Dieter @ DWorks Posted November 23, 2012 Share Posted November 23, 2012 You need to duplicate the path first because the path can't be modified like you want because it's a path of a path based pio. Quote Link to comment
Hippocode Posted November 23, 2012 Author Share Posted November 23, 2012 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); Quote Link to comment
Recommended Posts
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.