News:

Happy New Year!

Main Menu

wapperdude's Challenge

Started by wapperdude, December 06, 2024, 03:44:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

wapperdude

Asynchronous, random blinking, color changing shapes.  Code plus demo file.  It could be simple; monochromatic (extremely boring) or has many as , oh, 10 different, random colors.  Truly cool, make it look like blinking lights on a Christmas tree.

There is no prize.  Just satisfaction.  Yes.  Satisfaction IS possible, contrary to the song stating otherwise.

Have fun.  Enjoy. 

And challenge ends Christmas day, Dec 25th, 2024.
Visio 2019 Pro

Yacine

That's a very neat one.
And guys, I just checked the random function in the shapesheet. It's working again. Thank you M$.
Yacine

Paul Herber

That's the thing about random functions. You don't know when it will stop working again.
 :'(
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

wapperdude

Woo Hoo!!!

That means, amongst other things, that both Visio Guy's and my posts re Sketchy lines / shapes are once again functional.  Tried and tested.  How did they do that?  Must've been an Office update???
Visio 2019 Pro

wapperdude

Oh.  I didn't explicitly say it, but the randomness needs to be automated.  Twinkling lights, eh?
Visio 2019 Pro

Yacine

#5
Hello Wayne,
I am thankful that you took the lead to call for a Visio Christmas Wish.
Your challenge is certainly a great one. In fact, it truly thrilled me!

I immediately imagined a sophisticated Visio tree, and it was clear to me that it couldn't possibly be just blinking lights.

Using AI, I brainstormed ideas involving 3D visualization, a timeline, tree growth, and plenty of puns and jokes. This led me to dive deep into botany — examining how trees grow—and later into fractals and object-oriented simulation (in Python, of course). After a week, I discovered a Python library that already handles these tasks with L-Systems. Instead of reinventing the wheel, I decided to focus entirely on Visio's features. That's why I opted to neglect a tree visualization in favor of working on your "lights".

This is not to say there's no tree at all. It's there, but you'll need to imagine it for yourself. The lights suggest its form through their positions.

What I Implemented
I created a smartshape that offers the following functionality:

A group shape with two control points:

  • One for the XY position on the top-view plane.
  • Another for the elevation (Z) on the front-view plane.
  • The group contains a "light holder," which is itself a group. You can open this light holder in a separate group window (using the drawing explorer) and insert any smartshape to represent the blinking light you're aiming for.

Smart Features on the Page
Most of the smartness resides on the page itself, along with some specialized shapes:

  • A perspective view rectangle: Displays the "lights."
  • A top view: Allows you to define the XY coordinates of the lights.
  • A front view: Lets you set the elevation.
  • To retrieve the actual shapes of these views, I used custom properties where you can write the shape IDs. Using "SetF/GetRef," I linked the correct formulas, which define all the geometry variables in the drawing. Check the page's shapesheet for details.

The Smart-Light Functionality
The smart-lights' main task is to define their positions in 3D space and project them onto the perspective view, using two control elements:

  • A rotation rectangle, which defines the rotation around the tree.
  • An inclination vector, which defines the angle from which you view the tree.
  • The magic happens when you grab the rotation handle of the rotation shape and keep rotating it. The tree becomes animated!

The inclination reflects its angle directly in the perspective view. Two extreme points are:

  • 0 degrees: All the lights align horizontally on their respective elevation.
  • 90 degrees: Lights move in perfect circular trajectories.


The Lights Themselves
The smart-lights contain the "light holder" as a group. Using the drawing explorer, you can retrieve it for a particular light, use the "open group" function, and insert any smartshape you like.

I've prepared some masters in the document's stencil, but the smartness is entirely up to you—the sky is your limit!

Here's what I've done so far:

  • Basic Light: A simple light whose glow size changes gradually when rotating the tree. Its color can be set manually.
  • Color-Changing Light: A master that shifts the hue of its color. Luminosity and saturation can be set manually.
  • Star for the Top of the Tree: This is a cluster of diamond shapes with random lengths and angles. It could still use some fine-tuning.

Conclusion
This concludes my explanation. I hope I haven't overlooked any important points.
And just to clarify: there's no code involved here. Everything is achieved purely with shapesheet smartness.
So, this is my contribution to your challenge. I look forward to see my ranking in the results of your challenge call.

You cannot view this attachment.
Yacine

Yacine

#6
Quote from: Paul Herber on December 07, 2024, 08:03:37 AMYou don't know when it will stop working again.

Right, they probably have another definition of random. It's not the random value, but whether it will or wont at all. Totally legit!
You could say, they pushed the notion of randomness to a new limit.
It's up to us to cope with it.
Yacine

wapperdude

@Yacine:  That goes way beyond "Cool!". So much more than I imagined.  Enjoyed the "journey".   Both that and the pic are exciting and compelling.  I'm away from my PC, so haven't explored the Visio file.

Fractals can be quite interesting.  I've "played" with them in the past.  To invoke a Charles Dickens image, seems like you were visited by Ghost of JuneTheSecond...all those different views, 3D effects.

Elevates possibilities of using Visio.
Visio 2019 Pro

Thomas Winkel

Very cool Yacine, that looks like a lot of work and complex geometric calculations.
Mine is much simpler and with 14 lines of VBA code.

wapperdude

@Thomas:  was there supposed to be an attachment?
Visio 2019 Pro

wapperdude

Here's my effort at Christmas tree with animated, blinking lights.

You cannot view this attachment.
Visio 2019 Pro

Thomas Winkel

Quote from: wapperdude on December 16, 2024, 08:59:06 PM@Thomas:  was there supposed to be an attachment?
No, I'm not in the Christmas spirit yet.
I'll submit begin of next week. 🎄

Thomas Winkel

#12
I wish you all a nice fourth Advent 🕯🕯🕯🕯

Right click on any candle to start & stop the animation.
You can set parameters for each candle individual in the shape data.
Only "Interval" is a global setting, but you can set it on each candle.

wapperdude

Had fun playing with the various flame parameters.  Much fun.
Visio 2019 Pro

Yacine

The candles are so nice, I tried to put them in my tree. But due to the loop the animation of the rotation is not smooth. I would probably need to animate the tree as well.
Great job.
Yacine

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 455 (show)
Files included: 32 - 1207KB. (show)
Memory used: 1272KB.
Tokens: post-login.
Cache hits: 14: 0.00234s for 26,543 bytes (show)
Cache misses: 4: (show)
Queries used: 20.

[Show Queries]