生成艺术自行车油漆工作

16,309

136

29

Introduction: Generative Art Bike Paint Job

About: I make things

Earlier this year, I bought myself a second-hand beat-up road bike. It was covered in scratches and was starting to show signs of rust in places. The bike wasn't anything special, but I decided that I'd paint it pink because pink is the best colour. At first, I thought this would be a quick and dirty job, but 3 months later, a custom Inkscape plugin, bike-sized vinyl stickers, and a number of replaced parts, it appears scope creep got the better of me.

看看绘画自行车的选择时,我遇到了spray.bike,一种特定于自行车的喷漆类型。它很容易使用,并创造一个非常酷的粉末涂层纹理。在Spray.bike上检查了一些惊人的灵感后Instagram pagemy head was full of crazy ideas for designs for my own bike.

我觉得它有多酷图案模式环绕自行车的主管。我以为它会给它一个独特的有机外观。

我遇到了过去的图案也称为反应扩散模式。它们是一种模式,这些模式可以与某种类型的河豚的豹子外面爆裂。关于模式的冷却是什么,它可以通过一对微分方程来描述它的过程。这意味着您可以使用计算机模拟模式的生成。甚至还有一个互动的演示通过Github用户PMneila。

我是一名计算机科学学生,所以这种事情真的很兴奋。我想有一个专门为我的自行车产生自己的转型模式。所以,在这种指导中,我要记录我如何做到这一点,希望激励你尝试类似的东西。

Step 1: Striping the Bike Down

The only parts of the bike I wanted to paint were the frame and forks. My first challenge was then to strip down the bike so I could easily access just these parts. I wouldn't say I knew much about bikes when I started this project, but taking apart a bike and putting it all back together is a great way to learn!

To make sure I knew how everything went back, I took lots of pictures of each of the parts I was removing and made sure to keep everything separate.

Taking the bike apart wasn't without casualties though. I managed to strip the threads on the inside of the crank that were used to pull it off the bottom bracket. I had to bring the bike to the bike shop for them to remove this for me with an angle grinder. Also, the stem had managed to corrode itself stuck into the fork tube. No amount of degreaser, penetrating oil, and brute force could get it unstuck. I hade to resort to chopping the stem off with a hacksaw and then using the saw blade to cut out the stem from the inside. By hammering the piece from the bottom side of the fork, I eventually managed to get it out.

After getting the forks free and all the remaining parts off the bike, I removed the decals with a craft knife and gave the parts a thorough clean with a bike cleaning product.

第2步:测量自行车

The plan was to paint the bike with a base colour, and then have a vinyl sticker mask. I'd then coat the bike with a final coat and remove the mask. I would then be left with the pattern on the bike.

The next step of the project was then to measure up the parts of the bike I was going to make a mask for. The way I did this was to measure the lengths of the tubes with a tape measure. Then for all the more complex joints, I covered them in masking tape. I cut around these parts with a craft knife and removed the remaining tape. The tape created a 2D unwrapped version of the joints of the bike. I used a pair of calipers to measure some of the other dimensions as well.

One thing I kept in mind was where the seam would be in the final design. Even though I was hoping that my pattern would match all the way around the tube, I knew that any small mismatch might be quite obvious. I made sure to have all the seams at the bottoms of the tubes where it would be less obvious.

I then scanned the shapes to bring them onto my computer and trace around them in the vector graphics toolinkscape.。I could import the scanned page with all the unwrapped joints into my Inkscape document. I just had to scale it so the dimensions in Inkscape matched the dimensions that I had measured on the bike.

第3步: Writing an Inkscape Extension

我想生成适合自行车的不同部分的形状的图案,并在管周围没有明显的缝隙。我唯一可以认为这样做的方法是为此目的来构建一个工具。我希望这些模式以SVG格式为,以便我可以使用乙烯基刀片切割不同件的形状。这样做的好方法似乎直接在Inkscape内完成,并写出自定义扩展名。

What I love about open source software such as Inkscape is that it is often very easy to get started hacking around with code that interacts with the program through extensions and plugins. There are some good examples of extensions that come pre-installed with Inkscape that I played around with to come up with my own. Since this was really only going to be a one-off project I didn't polish up the code very much and I would call it more of a hack than anything else.

插件“看到”的作品被选中时,n converting that to a bitmap, it then runs the algorithm over the bitmap for a number of iterations, then converts the resulting bitmap back to an SVG and inserts it back into the original file. The code for running the pattern generation is mostly modified fromBen Maier's great python tutorial on Turing patterns

I've attached the extension here. In order to enable it put the files in your default Inkscape extensions folder. The "diffusion_reation.txt" file needs to be renamed to "diffusion_reaction.inx" - Instructables won't let me attach files of that format.

如果您有兴趣编写自己的Inkscape扩展,则没有太多的文档来帮助开始,但有很多existing extensions可以用作示例。

Step 4: Using the Inkscape Extension

追踪形状从步骤2,我创建的a solid object in one colour. I then put a black background behind the object to create a rectangular-shaped boarder. The extension converts the input into a rectangular bitmap and treats the world as a torus (so the edges match). The bits in black tell the extension not to simulate the pattern there. I then covered the shape with a bunch of other shapes in another colour, this doesn't really matter much, but these shapes act as "seeds" for the pattern to work from. By having lots of "seeds" it means that the simulation needs fewer cycles to propagate fully around the shape. This is good because the simulation is pretty inefficient and takes lots of time anyway. To run the extension I went to "Extensions>Diffusion Reaction". It comes up with a prompt about how many cycles to run for and the dpi (dots per inch). Higher dpi and more cycles take longer but may create a more complex and finer pattern.

After running the simulation, it should insert the pattern back into the Inkscape document in the same position as the original shape.

正如我在上一步中提到的那样,这个扩展非常不受欢迎,不是一个非常强大的代码,但适用于我的目的。鉴于它是用Python编写的,并且在大型2D阵列上运行许多操作,它不是最有效的,因此它可能看起来像Inkscape在运行时冻结,但它最终完成。

Step 5: Creating the Vinyl Stickers

我真的很幸运,有一些拥有乙烯基刀具的朋友。我能够让他们削减我设计的模式,以便我可以将它们转移到自行车上。首先将图案切成乙烯基,然后用一对剪刀将它们切割成尺寸,我删除了所有的位,我不想转移到自行车上,然后用一些转移纸将贴纸放在一件上到自行车上。

The vinyl comes on a large roll which is perfect for the long stickers that are used for the tubes of the bike.

第6步:喷涂底漆和基色

我自己建造了一个使用回收箱,拖把把手,拖把手柄,以及来自花园周围的一些大岩石的架子。我使用遮蔽胶带以防止涂料,从我想要保持清洁的任何部分。

The first layer was a "Smoothing Putty" that helped cover the remaining rust and scratches. The next layer I put on was a light blue. and finally, I used a darker blue to blend into the light from the bottom of the frame upwards. This created quite a nice effect, and I wasn't too worried to make a mess of this step, because the colors were quite close, and the pattern would be covering most of this anyway.

第7步:包裹自行车

After letting the paint dry overnight, I set about sticking on the vinyl stickers I had made. This was rather challenging, but I took my time and touched up any bits I wasn't happy with, with some extra vinyl and a craft knife. I started with the smaller sections and moved up to the larger tubes. I made sure that the sticker was properly stuck before removing the transfer paper.

在贴纸被困的贴纸上,我真的很激动,并对下一步感到非常兴奋。

Step 8: Second Colour

一旦贴纸上,我就会在一层粉红色中涂上一切。我很担心这样做,因为我不想毁掉我以冲突的颜色覆盖它所做的所有工作。

第9步:删除贴纸并添加光泽

在给粉红色的层次晾干后,我仔细拆下了贴纸以揭示设计。删除贴纸非常令人满意,揭示了我为此感到骄傲的令人惊叹的外观。

To give the bike a glossy finish and the paint some protection from scratches, I used a whole can of the spray.bike transparent gloss finish. This gave the frame a professional feel.

Step 10: Putting It All Back Together

一旦光泽干燥,我会把所有的零件放回自行车后,给他们一个良好的干净。我不得不让自己成为一个新的茎和底部支架,更换在拆除期间被破坏性地删除的杆状支架。

我的兴趣如何让我非常感到自豪。

I hope you enjoyed this Instructable and are feeling inspired to go and paint a bike of your own!

Bikes Challenge

一等奖
Bikes Challenge

Be the First to Share

    Recommendations

    • Make it Glow Contest

      Make it Glow Contest
    • First Time Author Contest

      First Time Author Contest
    • 任何比赛

      任何比赛

    29讨论

    1
    爱德德普2.

    8 weeks ago

    Hands down, most awesome bike customisation I've ever seen.

    0
    yonatan24

    3个月前

    I've head that removing the stickers/tape while the hasn't hasn't dried completely can create sharper lines, have you dried this?
    可能较少的涂料剥落/剥离。
    看起来很棒!

    0
    爱德德普2.

    Reply 8 weeks ago

    Might be tricky to lift the stickers without disturbing the drying paint.

    0
    yonatan24

    回复3个月前

    *Before the paint has dried

    0
    ollie242

    回复3个月前

    哦!是的,我把它留下了几个小时在剥落贴纸之前晾干,但油漆说将它留在一夜之间以完全治愈。我非常满意这些线条的清脆。但这根本不会让我感到惊讶。我没有尝试过很多。也许我应该得到另一辆自行车来油漆:)

    2
    phil_347

    Question2个月前第3步

    嘿!我真的很喜欢这种模式,我尝试使用你的扩展,我收到一个错误,说没有找到模块matplotlib。我用pip安装了matplotlib,没有什么改变,你有什么想法如何解决这个问题吗?

    0
    ollie242

    2个月前回答

    嘿!I'm happy you like it I'm going to look into this. I'm not the best at writing robust pieces of multi platform code so bare with me.

    0
    blorgggg.

    Reply 2 months ago

    cool work! I installed my extension into inkscape 0.92 and it shows up in the menu, but there is no option that pops up to click when using it.

    0
    blorgggg.

    Reply 2 months ago

    Upgraded my inkscape and it shows up, now i just get that matplotlib error others get, ahahhaha :)
    回溯(最后最新呼叫):
    文件“diffusion_reaction.py”,第29行,<模块>
    from matplotlib import image as im
    ModuleNotFoundError: No module named 'matplotlib'

    0
    phil_347

    Reply 2 months ago

    I don't know a whole lot in python, but let me know if I can be of any help!

    0
    ollie242

    Reply 2 months ago

    好的,我花了一段时间试图工作。因此,它用自己的Python解释器拒绝了Inkscape船只,因此当您执行正确的位置时,您可以在正确的位置安装包。我在我的电脑上设置了它,以便inkscape扩展使用我的计算机的Python解释器。我又回来了,因为某种原因并忘了它。这是如何做到的链接https://wiki.inkscape.org/wiki/index.php/Extension_Interpreters。我试图在虚拟机上重现它,但由于某种原因,Inkscape无法找到Python2.7。让我知道你是怎么办的 :)

    0
    phil_347

    Reply 2 months ago

    嘿!它运作了,我不再收到错误消息。我尝试了这个模式并开始了这个过程。我让它运行至少45分钟,因为我认为它正在花费太久(24 dpi和1000次迭代),我需要选择某些对象,是否对扩展有关的颜色是工作的?我非常感谢您的快速反馈BTW!

    0
    ollie242

    Reply 2 months ago

    Nice! Did the whole of Inkscape freeze or did the dialog box just stay there? if it isn't frozen probably it finished running but just didn't do anything. Sometimes I've found I have to select all the pieces, then unselect the bounding box piece and reselect it so that it looks like the bounding box is the last piece selected. Not sure if that is clear.

    0
    ollie242

    Reply 2 months ago

    Here's a gif

    0
    phil_347

    Reply 2 months ago

    It doesn't seem to work for me.. in the last gif you posted did you keep a black rectangle behind the pink one?

    0
    ollie242

    Reply 2 months ago

    只有一个简单的矩形是必需的黑色矩形。我使用它在可指导中的原因是避免围绕形状的顶部/底部缠绕的模式。它为模式创造了更明显的边界。但是如果您使用的是使用黑色矩形,请选择它。为此,请选择所有内容,按住Shift,然后单击边界形状两次。这使得扩展名知道它是边界框。(是的,我知道,不是非常直观)。

    0
    ollie242

    Reply 2 months ago

    What happens when you make a single blue rectangle, then run the extension for 1 iteration on it?

    0
    phil_347

    Reply 2 months ago

    This is what it looks like. Just to make sure, I need to have python 2.7 installed for the extension to work right? I also have python 3.9 installed.

    0
    ollie242

    Reply 2 months ago

    Yeah, python 2.7. One iteration should create a black rectangle. I'm not sure why it's not working.

    0
    phil_347

    Reply 2 months ago

    嘿!I tried on a Linux environment and I get this message in the extensions log file:
    Extension "Diffusion_Reaction" failed to load because a dependency was not met.
    依赖性:
    类型:文件
    地点:路径
    字符串:delmusion_recoute.py.

    Do you have any idea of what that means? When I try to use the extension I get this weird behavior.