Visio Guy

Visio Discussions => General Visio => Topic started by: alk on October 20, 2014, 05:04:11 PM

Title: converting arcs to polylines
Post by: alk on October 20, 2014, 05:04:11 PM
I do a lot of tracing work, when tracing freeform object I battle to do so with Visio, how can I convert the cusps/arc points on a polyline (which are very rigid and can only be moved up and down) into freeform points (i.e. like the green points which are movable in all directions on the freeform tool) which are movable in all directions. The freeform tool is too inaccurate, so is fit curve tool, round corner tool also does not do the job properly.
Title: Re: converting arcs to polylines
Post by: Yacine on October 20, 2014, 06:34:29 PM
If you "join" the shape, you'll get the desired free form points.
Title: Re: converting arcs to polylines
Post by: alk on October 20, 2014, 07:07:33 PM
I have tried that action: shape>operations>join, the polyline cusps/arcs still remain rigid, I need to be able to move the cusps around in all directions to that I can trace odd line forms. :(
I wan to be able to trace with the line tool, then move the cusps around.
Title: Re: converting arcs to polylines
Post by: Yacine on October 20, 2014, 08:25:02 PM
I don't really understand your problem. Having changed the curve to a polyline, you can then add vertices with the pen tool, then edit them.
Title: Re: converting arcs to polylines
Post by: JuneTheSecond on October 20, 2014, 10:57:11 PM
How would you like using Shape.Paths property?
For example,
http://visguy.com/vgforum/index.php?topic=5639.0

Here is short video how the macro runs.
http://youtu.be/sqLKx8Izq5E
Title: Re: converting arcs to polylines
Post by: wapperdude on October 21, 2014, 04:49:34 AM
For tracing, it should be adequate to use the line, curve and pencil tools.  Basically, you outline the shape, making "chord" lines across the curves.  The pencil tool can be used to draw the lines then uses to grab the inflection point to "bend" the line as needed.  Sometimes, the curve tool is a little more powerful, because you can select the inflection point with the pencil tool, which will cause the curve handles to appear and gives you the ability really customize and manipulate the curve.  But, generally, it's sufficient to draw line segments and then bend them.

This topic gives you an idea of what might be accomplished:  http://visguy.com/vgforum/index.php?topic=586.msg2496

The attached Visio file shows an incomplete tracing.  Note, with the pencil tool, you can always control click on a line and insert an node.

HTH
Wapperdude
Title: Re: converting arcs to polylines
Post by: alk on October 21, 2014, 06:01:06 AM
Thanks, perhaps I did not explain myself correctly, I draw fairly complicated vector images for patent illustrations, many times I need to draw odd shapes such as people or machinery at awkward angles, see attached. The line tool and the pencil tool and the arc tool, in conjunction with the levers are too crude, so is converting a polyline to a curve function.
I would ideally like to use something like the bezier tool that CorelDraw has, or a more refined freehand tool which has nodes which I can manipulate with ease.
See attached example (man with book in hand) as to the types of images I need to trace. How can I do an 'exact' trace of the red squiggle in the attached?
Title: Re: converting arcs to polylines
Post by: wapperdude on October 21, 2014, 06:32:48 AM
Not impossible with Visio, see attached.  Could be better by adding a few more nodes.  Yes, Visio tools are somewhat "crude", so it takes more time and patience.

So, why not use a drawing tool?  You mention CorelDraw.  Too pricey?  There are some open source drawing tools available that ought to provide the type of capability that you need.  There's also DrawPlus which is relatively inexpensive and has plenty of drawing power.

Wapperdude
Title: Re: converting arcs to polylines
Post by: alk on October 21, 2014, 10:36:37 AM
Nice, you used the line and pencil tool and handles on the cusps to angle the curvature of the cusps. Your result is pretty accurate. I have tried that technique in the past but found it to be too cumbersome, also the handles are hard to work with. I was kind of hoping I could convert a polyline into a spline [like the fit-curve tool] without the curve 'jumping out of line' pun intended, then I would just drag the line midpoint nodes to wherever I like. Another package is not a good option- To use another package would slow me down too much. I would rather bit my lip and work with Visio for an occational difficult sketch here and there.
Title: Re: converting arcs to polylines
Post by: vojo on October 21, 2014, 02:18:36 PM
would pathalong and points help this effort?

Set pathalong tolerance pretty tight so that you lots of little line segments
The points would define the begin/end of each segment in the array

Sort of how sketchup does arcs (lots and lots of little straight lines)
Title: Re: converting arcs to polylines
Post by: alk on October 21, 2014, 02:34:13 PM
Vojo, that sounds interesting, just tell me how to do it, I have been tracing woth Visio for 4 years, so I am familiar with the package but not with the terms you are using "Set pathalong tolerance pretty tight", please spell it out for me what you are referring to, is it: select polyline>shape>operations>fit curve, or some other exciting function I have overlooked!?
Title: Re: converting arcs to polylines
Post by: vojo on October 21, 2014, 04:11:31 PM
its a VBA function....you would have to write VBA to do this.

Basically, you give it a selection and define tolerances....it will return an array of points along the line subject to tolerance
(wide tolerance = beginning and end points of line.....narrow tolerance = array of say 20 points).   From the array you could
construct a polyline from the array (or set of geometries from the points array)

polyline[begin,N,N,N+1,N+1,N+2,...,N+M,end]

Some thing like
   Line1 = begin to N
   Line 2 = N to N+1
   Line M = N+M, end
Title: Re: converting arcs to polylines
Post by: vojo on October 21, 2014, 04:25:39 PM
details in the developer reference
Look at points function for details

This is the example in development reference

Public Sub Points_Example()

    Dim vsoShape As Visio.Shape
    Dim adblXYPoints() As Double
    Dim strPointsList As String
    Dim intOuterLoopCounter As Integer
    Dim intInnerLoopCounter As Integer

    Set vsoShape = ActivePage.DrawOval(1, 1, 4, 4)

    For intOuterLoopCounter = 1 To vsoShape.Paths.Count

        vsoShape.Paths(intOuterLoopCounter).Points 0.1, adblXYPoints
        For intInnerLoopCounter = LBound(adblXYPoints) To UBound(adblXYPoints)
            strPointsList = strPointsList & adblXYPoints(intInnerLoopCounter) & Chr(10)
        Next intInnerLoopCounter

    Next intOuterLoopCounter

    Debug.Print strPointsList

End Sub 


Title: Re: converting arcs to polylines
Post by: alk on October 21, 2014, 04:54:01 PM
great, I will give it a try, if I can figure out how, I have zero programming skills.
Title: Re: converting arcs to polylines
Post by: alk on October 27, 2014, 12:47:04 PM
WapperDude- I have re-read your advice and given it a try, and it seems to work well, I draw a polyline with the arc tool and then come back and adjust the arcs. Thanks.