Visio Guy

Visio Guy Website & General Stuff => User-submitted Stuff => Topic started by: JuneTheSecond on April 12, 2015, 04:51:04 AM

Title: Constant Length Line and Chain
Post by: JuneTheSecond on April 12, 2015, 04:51:04 AM
Here is a drawing containing some example of constant length line and chain.
And here is a short video explaining the functions of these shapes.
https://youtu.be/-5UDxXJ9ZPU

Please enjoy.
Title: Re: Constant Length Line and Chain
Post by: Yacine on April 12, 2015, 08:57:45 AM
Very cool!
Title: Re: Constant Length Line and Chain
Post by: vojo on April 13, 2015, 03:10:05 AM
cool....can you do this with shapes (link several shapes in a chain and drag the chain around)?
Title: Re: Constant Length Line and Chain
Post by: JuneTheSecond on April 13, 2015, 06:46:44 AM
Making long chain is not hard.
But this is too long.
Title: Re: Constant Length Line and Chain
Post by: Visio Guy on April 15, 2015, 09:13:31 PM
This is beautiful! And really fun when you pull the worm around with the Surface Pro 3 pen!

I added a connection point onto the tail, so you can glue your own worm segments together.
Title: Re: Constant Length Line and Chain
Post by: JuneTheSecond on April 16, 2015, 10:51:43 AM
Thank you Visio.Guy, I forgot connection point.
Now Connection Added and Deleted events enable me to think about something more fun.
Title: Re: Constant Length Line and Chain
Post by: Yacine on April 16, 2015, 01:45:42 PM
Hi Junichi,
I see 2 immediate applications for your technic.
1) mechanical transmissions (http://www.igm.rwth-aachen.de/getriebemodellsammlung/home/liste.php?order=gts_nr (http://www.igm.rwth-aachen.de/getriebemodellsammlung/home/liste.php?order=gts_nr))
2) Comics / drawn bodies where the limbs need constant lengths, but also the necessity to be drawn freely to what ever position they need to by. This would/could end up in a kind of reverse kinematic tool. (you remember my playing with comic characters (http://visguy.com/vgforum/index.php?topic=1572.0 (http://visguy.com/vgforum/index.php?topic=1572.0))


The problem: I don't know if/how this technique can be applied to shapes bound to TWO different shapes.
To explain:
1) In a transmission mechanism the shape could be linked to a fixed position on one side, but follow a driving shape from the other one.
2) With a comic character, I need to link the arm to the body, but want to move it by dragging the hand.
Title: Re: Constant Length Line and Chain
Post by: Visio Guy on April 16, 2015, 04:08:48 PM
So I was dragging these things around and around and around the ellipse, wondering whether they would converge onto the ellipse itself. I'm not sure if it is speed-sensitive or not, I think the resulting "worm" is some sort of elliptical spiral. The worm does not ever seem to converge onto the ellipse (maybe a small number of very short segments would.)

I wonder if there is some sort of name for this phenomena, and whether engineers or scientists have a use for it?
Title: Re: Constant Length Line and Chain
Post by: Visio Guy on April 16, 2015, 09:17:07 PM
Übrigens ist die getriebemodelldsamlung der Hammer!
Title: Re: Constant Length Line and Chain
Post by: JuneTheSecond on April 17, 2015, 09:09:34 AM
Thanks everybody.
Mechanical transmission is interesting theme!
Here is a short YouTube video of my trial. Piston mechanism.
https://youtu.be/ZYiYjGcz3PE

Please enjoy.

By the way the add in used to rotate a line in video is written in VS 2013 Community.

Private Sub Button12_Click(sender As Object, e As RibbonControlEventArgs) Handles Button12.Click
        Dim Ang As Double
        Dim shp As Visio.Shape
        Dim x As Double, y As Double
        Dim pi As Double
        Dim win As Visio.Window

        pi = Math.PI
        Ang = Convert.ToDecimal(EditBox1.Text) * pi / 180.0
        win = Globals.ThisAddIn.Application.ActiveWindow

        If win.Selection.Count <> 1 Then Exit Sub

        shp = win.Selection(1)

        If Not shp.CellExistsU("BeginX", False) Then Exit Sub

        x = shp.Cells("BeginX").Result("mm") + (shp.Cells("EndX").Result("mm") - shp.Cells("BeginX").Result("mm")) * Math.Cos(Ang) _
    - (shp.Cells("EndY").Result("mm") - shp.Cells("BeginY").Result("mm")) * Math.Sin(Ang)

        y = shp.Cells("BeginY").Result("mm") + (shp.Cells("EndX").Result("mm") - shp.Cells("BeginX").Result("mm")) * Math.Sin(Ang) _
    + (shp.Cells("EndY").Result("mm") - shp.Cells("BeginY").Result("mm")) * Math.Cos(Ang)

        shp.Cells("EndX").Formula = Str(x) + "mm"
        shp.Cells("EndY").Formula = Str(y) + "mm"
    End Sub
End Class
Title: Re: Constant Length Line and Chain
Post by: JuneTheSecond on April 20, 2015, 12:43:43 AM
Here is an example of a kind of link motion.
Also a short video in YouTube.
https://youtu.be/NHBQEBbbWD4

Please enjoy.
Title: Re: Constant Length Line and Chain
Post by: cliff50 on April 20, 2015, 01:22:46 AM
I watched the youtube single cylinder piston engine .. very slick !
it reminds me of my old victa lawn mower.

The other one reminds me of the driving wheels on old steam trains.. great work June  :D
Title: Re: Constant Length Line and Chain
Post by: JuneTheSecond on April 21, 2015, 11:58:33 AM
I made Bounded Length Line from Constant Length Line.
The length is bounded between small and large. It expands and contracts, but unfortunately elasticity.
It would be  better, if it is elastic like a rubber band.
The advantages are easy to close as a polygon, and more accurate to trace a free curve.

Here is a short video in YouTube.
https://youtu.be/sjPBQJy-WKU
Here is a Visio drawing for example.
Title: Re: Constant Length Line and Chain
Post by: Yacine on April 21, 2015, 04:35:11 PM
Hi Junichi,
going back to my mechanisms idea, I wonder if a combination of your technique and Wapperdudes SetAtReF article, would be a way to go, for getting line segments that can be moved from BOTH ends. (That's what those mechanisms require).
Title: Re: Constant Length Line and Chain
Post by: JuneTheSecond on April 30, 2015, 03:50:29 AM
Here is an example drawing of new lines, 2 way constant length line.
You can drag any side of constant length line.
Here is a short video in YouTube.
https://youtu.be/Fz6Wy_gjE7U

But unfortunately they are ready for amusement only.
They don't work in any valuable fields, as it cannot be glued to other shapes on any side of the line.
It is because I used SETF functions for both end of line.
I tried SETATREF function many times, but I could not find the good solution.

Title: Re: Constant Length Line and Chain
Post by: Yacine on April 30, 2015, 04:43:08 PM
Again the usual shapesheet magic. Very nice to look at.
Title: Re: Constant Length Line and Chain
Post by: Yacine on May 01, 2015, 06:52:30 AM
So, I took the time to look at your solution in depth.

Brilliant to use DEPENDSON to define the direction of the equation solving! There's a lot of potential in it.

But why is the formula "DEPENDSON('2WCLL.2'!EndX,'2WCLL.2'!EndY)" working ???
Why is Visio interpreting a string as correct reference for a cell?


Guess, that with a little bit of automation, one could setup mechanisms as I mentioned above.
A dialog to link shapes by writing the appropriate formulas in the "DEPENDSON" rows.
Title: Re: Constant Length Line and Chain
Post by: JuneTheSecond on May 01, 2015, 06:59:29 AM
Thank you Yacine!
It may not be working.
Because If you delete the DEPENDSON, there is no change in behavior!
Title: Re: Constant Length Line and Chain
Post by: Yacine on May 01, 2015, 07:15:26 AM
Quote from: JuneTheSecond on May 01, 2015, 06:59:29 AM
Because If you delete the DEPENDSON, there is no change in behavior!
Can you explain your statement?
I understood, that a two way calculation (dragging on each side independently requires the system to know in which way it has to calculate! If you're telling that deleting the DEPENDSON formulas doesn't change the behavior, then I wonder how the equations are solved.
Title: Re: Constant Length Line and Chain
Post by: Yacine on May 01, 2015, 07:38:37 AM
... and when I said that the DEPENDSON strategy has a lot of potential, I was thinking of a generic equation solver.
Some time ago, I tried to setup shapes to make calculations based on their connections and intermediate inputs.
The problem I was confronted with was that I wanted the calculation to be bi-directional: either you define the input and get the output, or you define the desired output and see what the necessary input would be. That's basically an equation solver.
I gave up after some time, because it involved too much external software.

I was hoping that the shapesheet solution you set up, with the dependson formulas could solve this problem.
Title: Re: Constant Length Line and Chain
Post by: JuneTheSecond on May 01, 2015, 10:43:22 AM
Yes, I believe you are right, but in this shape I recently found you can delete DEPENDSON.
I don't know why.
Here is an example drawing.
I am using Visio 2013 and saved this drawing as vsd.
Title: Re: Constant Length Line and Chain
Post by: JuneTheSecond on May 07, 2015, 10:06:49 AM
QuoteBut why is the formula "DEPENDSON('2WCLL.2'!EndX,'2WCLL.2'!EndY)" working ???
Why is Visio interpreting a string as correct reference for a cell?

I do not know why, either. Visio translated in such a manner, when I entered like Sheet.3!EndX.
But Visio translated into SETATREF(CLL.2!EndX), when I entered in another shape like sheet.4!EndX.

Is it a matter of first character of the shape name, number or abc?
Title: Re: Constant Length Line and Chain
Post by: JuneTheSecond on May 07, 2015, 10:28:22 AM
I have updated shapesheet functions in constant length line.
DEPENDSON(Angle,Width)+SETF(GetRef(EndX),BeginX+......... 
into
DEPENDSON(Width)+SETF(GetRef(EndX),BeginX+.........
Because, I thought it is only when Width changed that needs to trigger next SETF function.
Now the behavior became more stable and the end point can now more strongly snap to other shape.

And I combined the constant length line with a circle, it behaves like a compass, a kind of drafting tool that is used when the Visio was not yet invented.

Here is a describing short video in YouTube.
Please enjoy.
https://youtu.be/h9pkUrR2hJo
And here is an example Visio drawing.

Title: Re: Constant Length Line and Chain
Post by: ahawk11 on May 14, 2015, 10:22:57 PM
I like the idea of the line being perpendicular to the intersecting line and the worm line being extrapolated to correlate with the circle but I am wondering if it is at all possible to draw a copy of two lines and create a mirror image so that what you are seeing is essentially a duplicated bipartisan line inverted into a finite line? Just a thought...