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.
#46353 by rod_walker
Thu Feb 11, 2010 6:03 pm
I used the procedure setrotrel


Code: Select all setrotrel(mat,PI,y,topp);   {Mirror about apex}
     For j:= 1 TO 6 DO
     xformpt(p[j],mat,q[j]);
   
     END;


In the above mat is inbuilt type modmat. Rotation is PI (ie 180degrees). Y is the axis of rotation, in my case the 'y' axis. topp is the point about which rotaation occurs.

In my case I had 6 points in point array p which are mirrored int point array q. These are declared in the VAR sectioin of the procedure.
VAR
p,q :ARRAY [1..6] OF point;
mat :modmat;
#46355 by Joseph Baron
Thu Feb 11, 2010 9:46 pm
Thanks for the reply!

I was actually reading about setrotrel right before leaving the office and it sounded like that was what I was looking for, I'm just not familiar with using it yet. You showing it let's me know I was on the right track.

I will study your code and see if I can get it to work. Working with polylines for 2 days is a new entity type for me, I have my project normalizing the pverts so I know where 1 is at (minx, miny) no matter what the shape and have some linework added (from an existing project) to it so it's proved I can do with it what I need to, so far anyway.

Thank you again and I'll post back on the results...
#46365 by Joseph Baron
Fri Feb 12, 2010 10:35 am
Works like a charm! :D

Thanks again for your 'activity on the DDN'.
#46379 by rod_walker
Sat Feb 13, 2010 5:11 am
Great.
It is only doing a mirror about the orthogonal axis.
#46538 by Joseph Baron
Mon Feb 22, 2010 10:20 am
Well this worked OK as long as there were no bulges in the polyline.

I'm now looking at how to make this work when the entpln has bulges.

poly_fix will order the pntarr I give it and when there are bulges in the entpln they get "moved" to a different side of the shape.

The bulge is still at it's original end points, but since the end points get re-arranged in poly_fix the bulge is repositioned and now has a different radius.

So what I'm looking for is a 'poly_fix' that will accept the entpln entity instead of a pntarr.
#46614 by rod_walker
Wed Feb 24, 2010 5:47 pm
the manual describes polyverts as the 'type used for copious data associated with polylines and surfaces of revolution.'
Code: Select all 
polyvert = record
adrr: pvtaddr;  { the address of polyvert in database}
next: pvtaddr;  { the address of the next polyvert in chain}
prev: pvtaddr;  { the address of the previos polyvert in chain}
shape: integer; { value may be either pv_vert or pv_bulge}
pnt:     point;             
bulge: real;       {takes a value between + and - infinity. If 0.0 a straight line}
nextpnt: point; { coordinates of next polyvert in chain}
last: boolean;   { if true the polyvert is last in chain and field .next =nil}

If the value shape = pv_vert then the bulge field is ignored. If the shape field = pv_bulge then bulge contains a real number. 0.0 indicates a straight line. A negative value indicates a curve to the left and a positive value a curve to the right.

You need to reverse the sign of bulge. ie multiply the bulge value by -1.0.

Regards
Rod Walker
#46641 by Joseph Baron
Thu Feb 25, 2010 3:56 pm
Thanks Rod,

It's not the mirroring that's holding me up, it's the 'normalizing' of the polyline that contains bulges that's presented a new issue.

Sending pnts to poly_fix works before updating the entpln to those pnts as long as the entpln only has straight verts. Now I'm wantng to get bulges into the mix.

So it comes down to a 'poly_fix' type function that will work with entpln that contains both straight and bulge.
#46645 by rod_walker
Fri Feb 26, 2010 7:05 pm
poly_fix works on an array of points, so should you only be looking at the vertices of your polyline? After mirroring are you combining the mirrored polylines to create a new single entity?

Regards
Rod walker

Who is online

Users browsing this forum: No registered users and 25 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 Architects Since 1984