Traverse Ellipse into 1D using Path.Points

G

Guy..L

Dear Visio Developers:

I would like to take a smooth shape the user has drawn using Visio drawing
tool and
'digitize' it and then run a tool along its path. I have the code snippet
below to do this on Visio.Page p.
....
foreach (Shape toolPath in Job)
{
// get geometry values with respect to containing page
Paths Pn = p.Shapes[toolPath.NameID].Paths;

foreach (Path pth in Pn)
{
Array segments;
pth.Points(Epsilon, out segments);
....
I would like to "link" up this shape to a sequence of motion events such
that some real life
can move to the beginning of the digitized line segments, start operations,
perform the operations along "segments", stop operations at the end of the
ending line segment, and then
move on to the next shape.

My solution works until, say, an Ellipse is fed through the above code.
"segments" is returned where the the first two doubles are very, very close
to the last two doubles; but not exactly the same. I use
DrawPolyline(segments, ...PolyLine1D) to place an operations toolpath back in
place of the user-designed shape. (FYI, in an ellipse, Points returns a
digitized path where the begin and end point are East, ie theta = 0.)

I try to connect the motion (denoting movement without operations) shapes to
the "BeginX" and from the "EndX" of the fresh toolpath shape. The connection
to BeginX works ok and the trouble begins when I connect to the EndX. I find
the toolpath shape rotated or otherwise whacked and out of sync with the
original design shape. My guess is that EndX and BeginX are very close
together and that while connecting to EndX, the toolshape gets nudged since
EndX and BeginX are within Epsilon of each other.

How can I have the toolshape behave while I'm connecting to it?
Incidentally I am connecting 2D shapes that have a Connections.Center
connection point in their masters. I cannot seem to connect from
toolShape.EndX to Connections.Center only the other way around.

Another way to think of this is that once the DrawLine of the elliptical
shape is done, can I grab EndX and pull it away from BeginX breaking the
Closedness of the original Ellipse?

Regards,
Guy
 
J

JuneTheSecond

Hi,

In Visio.jp there are excellent examples.
http://www.visio.jp/program/anime02/index.html
However, you need to read and register as a user.

Outline is as follows.

1 Change the shape curves to nurbs curves.
2. Repeat next for each nurbs curve.
3. Make an array of the nurvs points.
4. Set PinX and PinY to the values of array.
5. Set adequate time delay to speed down the moving.

--
Best Regards.

JuneTheSecond
Now, visual calculation is more visual.
http://www.geocities.jp/visualcalculation/english/index.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top