Jump to content

A way to create a straw for your lemonade drink (2017-08-29)


Recommended Posts

This tutorial is available as a PDF. Click here to view or download it

 

A way to create a straw for your lemonade drink

 

First of all, try to work with large images (4000x4000) the finishing will be better after reduction.

But for this tutorial I will use 400x400.

 

Plugins needed:

Gridmaker https://forums.getpaint.net/index.php?showtopic=4175 

Paneling (optional) https://forums.getpaint.net/index.php?showtopic=2617 

Shape3D https://forums.getpaint.net/index.php?showtopic=18968 

(be sure to have the latest version if you want to use the XML files)

 

1.

Create your image (400x400 in my case). The color of the background will be the main color of the straw. White is good but you could test other colors.

 01_base.png  <-- yes it is a white image

 

 

2.

Add a new layer. Run Gridmaker plugin with these settings.

02_checker_UI.png 

 

25 is to have 16x16 squares checker. This number (16) should by a multiple of 4 for a better result.

 

 02_checker.png

 

 

3.

Using the magic wand tool select the 8 white squares of the top line.

 03_select8squares.png 

 

 

4.

Hide the top layer. The white layer is now active with the 8 selected squares.

Press M to switch to movement mode. Click and drag to make the selection on the full height of the image.

 04_drag_selection.png

 

 

5.

Choose the primary and secondary colors you want for the lines of the straw.

And with the paint bucket fill each part of the selection with primary and secondary colors alternatively.

 05_fill_selection.png

 

 

6.

These lines are too width. To shrink them invert the selection (Ctrl+I). The white bars are selected. Press Ctrl+C and Ctrl+V (copy and paste). You should be in movement mode (if not press M). Use the right cursor key (on the keyboard) to move the white bars 6 to 10 times (pixels) on the right (over the colored bars).

 05_fill_selection.png

 

 

7.

Press Enter to finish the selection. This was easy till now!

 07_finish_selection.png

 

 

8.

You could let the bars vertical or you could rotate them to create a regular spiral around the straw. For the second choice, we need to create an endless texture with the bars (bar going out of the image on the right side must fit with another bar entering on the left side. Use the Rotate/zoom tool (Ctrl+shift+Z) with these settings:

08_rotate_tilling.png

 

9.

You could check if the image is seamless by using the paneling plugin. if you move horizontally you should have continuous lines without step.

Vertically doesn't matter for this tutorial.

09_check_tilling.png

 

 

10.

Last step. Use the Shape3D plugin with these settings (or xml file). http://jcljay.free.fr/pdn/straw.xml (right-click, save as...)

10_final_straw_UI.png

Green are required, Orange are as you want to play with rotation, size, light, etc.

 

Final result

10_final_straw_1.png

Have you ever looked Inside?

10_final_straw_1inside.png

 

 

Other examples.

This is the xml for "Inside the straw" http://jcljay.free.fr/pdn/strawinside.xml (right-click, save as...)

 10_final_straw_2.png

 

10_final_straw_3.png

10_final_straw_3inside.png

 

10_final_straw_4.png

10_final_straw_4inside.png

 

Enjoy!

 

glass3_600.png

 

 

  • Like 4
  • Upvote 3
Link to post
Share on other sites

This is pretty cool @MadJik!  I will try this out.  Thank you for posting!   :star:    :)

  • Like 1
Link to post
Share on other sites
19 minutes ago, welshblue said:

the xml file isn't loading the settings your screenshot shows.  That's by the by though, nice easy tut to follow

 

That's a bug with Shape3D; it doesn't know how to handle a mismatch with the localized decimal points in the XML file.

i.e. The XML file was made on a computer with the decimal set to a comma, but your computer has the decimal set to a dot.

 

I'll talk to ERR about getting this fixed in Shape3D.

In the mean time, you can change your decimal point settings, or simply modify the XML file.

  • Like 2
Link to post
Share on other sites

Weeeeeeeeee............I made candy sticks!   This is pretty cool as I said in previous post.  I have a couple of ideas already!

Thanks, again @MadJik !     :D

 

drinkingstraw.png

  • Like 2
Link to post
Share on other sites

 

7 hours ago, toe_head2001 said:

I'll talk to ERR about getting this fixed in Shape3D.

In the mean time, you can change your decimal point settings, or simply modify the XML file.

 

For the meantime, modify the XML file. Any text editor will do the job. Open the file and replace all instances of the comma being used as a decimal separator in a number with a period.

 

Here's the edited XML for non-European countries...

 

<?xml version="1.0" encoding="utf-8"?>
<Shap3DSettingData xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Version>2</Version>
    <ObjectType>Cylinder</ObjectType>
    <ObjectData>
        <Sphere>
            <Scaling>1</Scaling>
            <HorizontalRadius>1</HorizontalRadius>
            <DepthRadius>1</DepthRadius>
            <VerticalRadius>1</VerticalRadius>
            <TextureMap>0</TextureMap>
            <TextureScale>1</TextureScale>
            <TextureRotate>0</TextureRotate>
        </Sphere>
        <Cylinder>
            <Scaling>2.03</Scaling>
            <HorizontalRadius>0.06</HorizontalRadius>
            <DepthRadius>0.06</DepthRadius>
            <Height>5.00</Height>
            <RoundedEdges>0</RoundedEdges>
            <TextureMap>0</TextureMap>
            <TextureScale>1</TextureScale>
            <TextureRotate>0</TextureRotate>
            <CylinderEnd>
                <TopStyle>Flat</TopStyle>
                <TopHeightOfBall>1</TopHeightOfBall>
                <BottomStyle>Flat</BottomStyle>
                <BottomHeightOfBall>1</BottomHeightOfBall>
            </CylinderEnd>
            <Face>
                <Top>False</Top>
                <Body>True</Body>
                <Bottom>False</Bottom>
            </Face>
        </Cylinder>
        <Box>
            <Scaling>1</Scaling>
            <Width>1</Width>
            <Depth>1</Depth>
            <Height>1</Height>
            <RoundedEdges>0</RoundedEdges>
            <TextureMap>0</TextureMap>
            <TextureScale>1</TextureScale>
            <TextureRotate>0</TextureRotate>
            <Face>
                <Front>True</Front>
                <Rear>True</Rear>
                <Top>True</Top>
                <Bottom>True</Bottom>
                <Left>True</Left>
                <Right>True</Right>
            </Face>
        </Box>
    </ObjectData>
    <ObjectRotation>
        <Axis1>
            <Type>X</Type>
            <Angle>270</Angle>
        </Axis1>
        <Axis2>
            <Type>Y</Type>
            <Angle>180.0</Angle>
        </Axis2>
        <Axis3>
            <Type>Z</Type>
            <Angle>0</Angle>
        </Axis3>
    </ObjectRotation>
    <MovePosition>
        <X>0</X>
        <Y>0</Y>
    </MovePosition>
    <Projection>
        <CameraAngle>10.6</CameraAngle>
    </Projection>
    <AntiAlias>
        <Switch>True</Switch>
        <Leval>5</Leval>
    </AntiAlias>
    <Transparency>
        <Switch>True</Switch>
        <AlphaChannel>144</AlphaChannel>
    </Transparency>
    <Lighting>
        <Switch>True</Switch>
        <StrengthOfLight>2</StrengthOfLight>
        <Direction>
            <X>-1.00</X>
            <Y>1</Y>
            <Z>-1.00</Z>
        </Direction>
        <Color>
            <R>255</R>
            <G>255</G>
            <B>255</B>
        </Color>
        <Lambert>
            <AmbientLighting>0.35</AmbientLighting>
            <DiffuseReflectionRate>1</DiffuseReflectionRate>
        </Lambert>
        <SpecularHilight>
            <Switch>True</Switch>
            <SpecularReflectionRate>0.3</SpecularReflectionRate>
            <HilightModel>Phong</HilightModel>
            <Phong>
                <PhongSize>50</PhongSize>
            </Phong>
            <CookTorrance>
                <RefractiveRate>1.4</RefractiveRate>
                <Luster>
                    <LusterType>Anisotropy</LusterType>
                    <Isotropy>0.2</Isotropy>
                    <AnisotropyX>0.3</AnisotropyX>
                    <AnisotropyY>0.15</AnisotropyY>
                </Luster>
            </CookTorrance>
        </SpecularHilight>
    </Lighting>
</Shap3DSettingData>

 

  • Like 1
Link to post
Share on other sites
50 minutes ago, Pixey said:

Why can't I think of these mathematical tricks with Plugins :(

Why do you think I use sort of mathematical tricks?

A lot of do/undo/redo in my tests. And when I found the right thing and when I have to describe how to do it, then it could seem mathematical. Not my fault! :grin:

  • Like 1
  • Upvote 1
Link to post
Share on other sites

Have you tried to look inside?

Spoiler

<?xml version="1.0" encoding="utf-8"?>
<Shap3DSettingData xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Version>2</Version>
    <ObjectType>Cylinder</ObjectType>
    <ObjectData>
        <Sphere>
            <Scaling>1</Scaling>
            <HorizontalRadius>1</HorizontalRadius>
            <DepthRadius>1</DepthRadius>
            <VerticalRadius>1</VerticalRadius>
            <TextureMap>0</TextureMap>
            <TextureScale>1</TextureScale>
            <TextureRotate>0</TextureRotate>
        </Sphere>
        <Cylinder>
            <Scaling>2.03</Scaling>
            <HorizontalRadius>0.06</HorizontalRadius>
            <DepthRadius>0.06</DepthRadius>
            <Height>5.00</Height>
            <RoundedEdges>0</RoundedEdges>
            <TextureMap>0</TextureMap>
            <TextureScale>1</TextureScale>
            <TextureRotate>0</TextureRotate>
            <CylinderEnd>
                <TopStyle>Flat</TopStyle>
                <TopHeightOfBall>1</TopHeightOfBall>
                <BottomStyle>Flat</BottomStyle>
                <BottomHeightOfBall>1</BottomHeightOfBall>
            </CylinderEnd>
            <Face>
                <Top>False</Top>
                <Body>True</Body>
                <Bottom>False</Bottom>
            </Face>
        </Cylinder>
        <Box>
            <Scaling>1</Scaling>
            <Width>1</Width>
            <Depth>1</Depth>
            <Height>1</Height>
            <RoundedEdges>0</RoundedEdges>
            <TextureMap>0</TextureMap>
            <TextureScale>1</TextureScale>
            <TextureRotate>0</TextureRotate>
            <Face>
                <Front>True</Front>
                <Rear>True</Rear>
                <Top>True</Top>
                <Bottom>True</Bottom>
                <Left>True</Left>
                <Right>True</Right>
            </Face>
        </Box>
    </ObjectData>
    <ObjectRotation>
        <Axis1>
            <Type>X</Type>
            <Angle>270</Angle>
        </Axis1>
        <Axis2>
            <Type>Y</Type>
            <Angle>180.0</Angle>
        </Axis2>
        <Axis3>
            <Type>Z</Type>
            <Angle>0</Angle>
        </Axis3>
    </ObjectRotation>
    <MovePosition>
        <X>0</X>
        <Y>0</Y>
    </MovePosition>
    <Projection>
        <CameraAngle>10.6</CameraAngle>
    </Projection>
    <AntiAlias>
        <Switch>True</Switch>
        <Leval>5</Leval>
    </AntiAlias>
    <Transparency>
        <Switch>True</Switch>
        <AlphaChannel>144</AlphaChannel>
    </Transparency>
    <Lighting>
        <Switch>True</Switch>
        <StrengthOfLight>2</StrengthOfLight>
        <Direction>
            <X>-1.00</X>
            <Y>1</Y>
            <Z>-1.00</Z>
        </Direction>
        <Color>
            <R>255</R>
            <G>255</G>
            <B>255</B>
        </Color>
        <Lambert>
            <AmbientLighting>0.35</AmbientLighting>
            <DiffuseReflectionRate>1</DiffuseReflectionRate>
        </Lambert>
        <SpecularHilight>
            <Switch>True</Switch>
            <SpecularReflectionRate>0.3</SpecularReflectionRate>
            <HilightModel>Phong</HilightModel>
            <Phong>
                <PhongSize>50</PhongSize>
            </Phong>
            <CookTorrance>
                <RefractiveRate>1.4</RefractiveRate>
                <Luster>
                    <LusterType>Anisotropy</LusterType>
                    <Isotropy>0.2</Isotropy>
                    <AnisotropyX>0.3</AnisotropyX>
                    <AnisotropyY>0.15</AnisotropyY>
                </Luster>
            </CookTorrance>
        </SpecularHilight>
    </Lighting>
</Shap3DSettingData>

Save this code in a file like inside.xml and load it with Shape3D

 

Link to post
Share on other sites

:arrow-up: Yes, I looked inside - looks like mambo-jumbo to me :lol:.   Just proves you are a mathematical whizz  (as are the others who write this CS stuff.) B)

  • Like 1

30b8T8B.gif

How I made Jennifer & Halle in Paint.net

My Gallery | My Deviant Art

"Rescuing one animal may not change the world, but for that animal their world is changed forever!" anon.

 
Link to post
Share on other sites
  • 7 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...