toe_head2001 Posted February 21, 2016 Share Posted February 21, 2016 (edited) Spoked Wheel Effects -> Render -> Spoked Wheel Change Log v1.1 (March 5, 2016) Changed: The range for Line Thicknesses now maxes out at 100 v1.0 (Feb 20, 2016) Initial release Download SpokedWheel.zip Spoiler <---- Icon GPL v3 // Name: Spoked Wheel // Submenu: Render // Author: toe_head2001 // Title: // Version: 1.1 // Desc: Generates a Spoked Wheel // Keywords: // URL: // Help: #region UICode IntSliderControl Amount1 = 5; // [3,20] Spokes DoubleSliderControl Amount2 = 1; // [0.1,1] Wheel Size DoubleSliderControl Amount3 = 0.333; // [0.1,0.9] Axle Size IntSliderControl Amount4 = 2; // [1,100] Rim Thickness ListBoxControl Amount5 = 0; // Rim Style|Solid|Dashed|Dotted IntSliderControl Amount6 = 2; // [1,100] Spoke Thickness ListBoxControl Amount7 = 0; // Spoke Style|Solid|Dashed|Dotted IntSliderControl Amount8 = 2; // [1,100] Axle Thickness ListBoxControl Amount9 = 0; // Axle Style|Solid|Dashed|Dotted AngleControl Amount10 = 0; // [-180,180] Rotation ColorWheelControl Amount11 = ColorBgra.FromBgr(0,0,0); // Color #endregion void Render(Surface dst, Surface src, Rectangle rect) { Rectangle selection = EnvironmentParameters.SelectionBounds; float centerX = ((selection.Right - selection.Left) / 2f) + selection.Left; float centerY = ((selection.Bottom - selection.Top) / 2f) + selection.Top; float diameter = (float)Amount2 * Math.Min(selection.Width - 4, selection.Height - 4) - Amount4; float radius = diameter / 2f; float offsetX = centerX - radius; float offsetY = centerY - radius; float axleDiameter = (float)Amount3 * diameter; float axleOffsetX = centerX - axleDiameter / 2f; float axleOffsetY = centerY - axleDiameter / 2f; float start = (float)Amount10; float sweep = 360f / Amount1; dst.CopySurface(src, rect.Location, rect); using (Graphics wheel = new RenderArgs(dst).Graphics) { wheel.SmoothingMode = SmoothingMode.AntiAlias; wheel.Clip = new Region(rect); using (Pen wheelPen = new Pen(Amount11)) { // Draw Rim wheelPen.Width = Amount4; wheelPen.DashStyle = getDashStyle(Amount5); wheel.DrawEllipse(wheelPen, offsetX, offsetY, diameter, diameter); // Draw Spokes wheelPen.Width = Amount6; wheelPen.DashStyle = getDashStyle(Amount7); for (int spoke = 0; spoke < Amount1; spoke++) { float degrees = start + sweep * spoke; double radians = Math.PI / 180 * degrees; float startX = (float)(radius * Amount3 * Math.Sin(radians)); float startY = (float)(radius * Amount3 * Math.Cos(radians)); float endX = (float)(radius * Math.Sin(radians)); float endY = (float)(radius * Math.Cos(radians)); wheel.DrawLine(wheelPen, centerX - startX, centerY - startY, centerX - endX, centerY - endY); } // Draw Axle wheelPen.Width = Amount8; wheelPen.DashStyle = getDashStyle(Amount9); wheel.DrawEllipse(wheelPen, axleOffsetX, axleOffsetY, axleDiameter, axleDiameter); } } } static DashStyle getDashStyle(byte style) { DashStyle dashStyle; switch (style) { case 0: // Solid dashStyle = DashStyle.Solid; break; case 1: // Dashed dashStyle = DashStyle.Dash; break; case 2: // Dotted dashStyle = DashStyle.Dot; break; default: dashStyle = DashStyle.Solid; break; } return dashStyle; } Edited June 14, 2020 by toe_head2001 7 Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
BoltBait Posted February 21, 2016 Share Posted February 21, 2016 You could shorten up the UI by changing those radio buttons into drop-down lists. Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
toe_head2001 Posted February 21, 2016 Author Share Posted February 21, 2016 You could shorten up the UI by changing those radio buttons into drop-down lists. Dang it, I meant to change those before posting. Anyway, they're drop-down lists now. Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
Eli Posted February 21, 2016 Share Posted February 21, 2016 (edited) Just what I needed, Thank you! Edited February 21, 2016 by Eli 2 Quote Link to comment Share on other sites More sharing options...
lynxster4 Posted February 21, 2016 Share Posted February 21, 2016 Thank you, toe_head! I'm sure I'll find a use for this... Just what I needed, Thank you! Space, the final frontier... Eli, Beam me up!! (I'm a huge Trekkie...) Quote My Art Gallery | My Shape Packs | ShapeMaker Mini Tut | Air Bubble Stained Glass Chrome Text with Reflections | Porcelain Text w/ Variegated Coloring | Realistic Knit PatternOpalescent Stained Glass | Frosted Snowman Cookie | Leather Texture | Plastic Text | Silk Embroidery Visit my Personal Website "Never, ever lose your sense of humor - you'll live longer" Link to comment Share on other sites More sharing options...
skullbonz Posted February 22, 2016 Share Posted February 22, 2016 Couldn't this be done with Red Ochre's Gears plugin ? 1 Quote http://forums.getpaint.net/index.php?/topic/21233-skullbonz-art-gallery Link to comment Share on other sites More sharing options...
Eli Posted February 22, 2016 Share Posted February 22, 2016 Hello skullbonz, Thanks for the tip, I tried Gears and this is what I came up " Not all spoked wheels are made the same" Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted February 22, 2016 Author Share Posted February 22, 2016 Couldn't this be done with Red Ochre's Gears plugin ? This plugin was specifically requested by @Eli. Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
Eli Posted February 22, 2016 Share Posted February 22, 2016 Yes, the Spoked Wheel effect is designed to slice a circle into equal parts. In the example above, both have 5 spokes. Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted March 5, 2016 Author Share Posted March 5, 2016 Version 1.1 posted. The Line Thicknesses can now go up to 100. Sorry Eli, I had this new version ready two weeks ago when you asked me about the line thickness. I simply forgot to post it. 3 Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
Eli Posted March 5, 2016 Share Posted March 5, 2016 Thanks toe_head2001, the adjustments work very well. The thicker lines are large enough when working on a very large canvas. Quote Link to comment Share on other sites More sharing options...
Maximilian Posted March 14, 2016 Share Posted March 14, 2016 Here's the plugin compiled for the old PdN: Spoked Wheel 1.1 for PdN 3.5.11.zip This may be a far-fetched application, but I think this is good for creating chopped trees, or maybe circular woody mazes. Of course the spoked wheel was just the starting point after which I had to do a couple additional things, but anyway, the spoked wheel took part and that's what counts Here are two quickies whose main objects I believe resemble chopped trees (maybe the first one looks more like a circular maze ). Perhaps the textures can be improved. Scene 1: Scene 2: 2 Quote Link to comment Share on other sites More sharing options...
Eli Posted April 27, 2019 Share Posted April 27, 2019 Hello @toe_head2001, the next time you update Spoked Wheel would it be possible to have more spokes? Something like 32. Thanks! Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted April 27, 2019 Author Share Posted April 27, 2019 6 minutes ago, Eli said: would it be possible to have more spokes? Something like 32. Thanks! There is no technical limitation, so if you want 32, just edit the source file. Change this from: IntSliderControl Amount1 = 5; // [3,20] Spokes to this: IntSliderControl Amount1 = 5; // [3,32] Spokes Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
Eli Posted April 27, 2019 Share Posted April 27, 2019 Thank you. I will do it. ☺️ This is not a fancy effect but I find it very useful. ⭐ Quote Link to comment Share on other sites More sharing options...
Blend3rman Posted March 20, 2020 Share Posted March 20, 2020 This is a neat little render tool for creating spokes behind a central object. I was wondering if the spokes could be made to taper as they got closer to the axle? Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted March 20, 2020 Author Share Posted March 20, 2020 4 hours ago, Blend3rman said: I was wondering if the spokes could be made to taper as they got closer to the axle? Sorry, there's no easy way to do that. Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
Reptillian Posted March 20, 2020 Share Posted March 20, 2020 (edited) 28 minutes ago, toe_head2001 said: Sorry, there's no easy way to do that. Agreed, there is actually a theoretical way I know how to do it. But, it requires warping image assuming distance from center is y and square borders as x, then create linear stroke, and transform it back where x axis is x and y axis is y. But, that is not easy at all. Actually maybe polar transformation would be easier to code in. A lot easier in fact. Edited March 20, 2020 by Reptillian Quote G'MIC Filter Developer Link to comment Share on other sites More sharing options...
Eli Posted March 20, 2020 Share Posted March 20, 2020 I am not sure if this can help but @MadJik's Light Rays... makes lines go from thick to thin. Spoiler Quote Link to comment Share on other sites More sharing options...
Reptillian Posted March 20, 2020 Share Posted March 20, 2020 (edited) The thing is that it's not consistent within the spokes. That's why I suggest polar transform. Generate the outlines within pre-transform vector, then polar transform right back. But, I'm not so qualified to know c# limitation in context of paint.net, but this is indeed possible within g'mic-qt and c++ within other programs. Edited March 20, 2020 by Reptillian Quote G'MIC Filter Developer Link to comment Share on other sites More sharing options...
Red ochre Posted March 20, 2020 Share Posted March 20, 2020 Could 'Gears' be an alternative? 1 1 Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.