Difference between revisions of "User:Le Forgeron/HowTo/Perfect glass"
Le Forgeron (talk | contribs) |
Le Forgeron (talk | contribs) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 73: | Line 73: | ||
===The right approach of CSG when pouring liquid=== | ===The right approach of CSG when pouring liquid=== | ||
+ | |||
+ | [[Image:LeForgeronTutoGlassCsg.png]] | ||
+ | |||
+ | The key points to make a glass with some liquid are: | ||
+ | # to place the liquid inside the glass | ||
+ | # to remove from that block the volume where the air is to be | ||
+ | |||
+ | ==== Caveat about the shapes of liquid and air ==== | ||
+ | The coincident surface's noise appears as soon as two identical surfaces share an area. | ||
+ | |||
+ | As a consequence, the shape of the air and the shape of the liquid must share only, on their surface, a common line. | ||
+ | |||
+ | There is no reason for the shape of glass to ever meet the shape of the liquid (or only in the part removed later by the shape of air), so that's part is safe. | ||
+ | |||
+ | === let me drink === | ||
+ | <pre> | ||
+ | difference | ||
+ | { | ||
+ | union | ||
+ | { | ||
+ | cylinder { ... | ||
+ | hollow | ||
+ | material { glas } | ||
+ | } | ||
+ | cylinder { ... | ||
+ | hollow | ||
+ | material { wat } | ||
+ | } | ||
+ | } | ||
+ | cylinder { ... | ||
+ | hollow | ||
+ | material { air } | ||
+ | } | ||
+ | cutaway_textures | ||
+ | hollow | ||
+ | } | ||
+ | </pre> | ||
+ | {|class="matte" width="700px" cellpadding="0" cellspacing="10" | ||
+ | |To avoid a common surface, the cylinder of air must overlap a part of the cylinder of liquid. | ||
+ | |||
+ | For the cap, it's easy. | ||
+ | |||
+ | For the tube, the radius of the air cylinder is just made a bit larger than the one of the liquid: here there is 1% less of glass than for the liquid; did you see it ? | ||
+ | |[[Image:LeForgeronTutoGlass3.png]] | ||
+ | |- | ||
+ | | Same thing, with a far bigger glass. | ||
+ | |||
+ | With such width of glass, it might be more realistic to work more on the bevel. | ||
+ | |[[Image:LeForgeronTutoGlassOver.png]] | ||
+ | |} |
Latest revision as of 17:52, 30 September 2012
Perfect glass
Welcome, if you are tired of coincident surface in your non opaque fluid containers, it might be the right place.
An easy test, as multiple-choice questions, to check the lesson of today:
- How do you make an empty plate ?
- You select a material, a shape and combine both.
- How do you make an empty glass ?
- You select a material, a shape and combine both.
- How do you put a cake on a plate ?
- Take the plate and and move the cake to the plate.
- How do you fill a glass with a liquid ?
- Take the empty glass and pour the liquid, well put the liquid in a suitable shape and move it to the glass.
- Mu. This is a non-sense.
The right answer is 2: to achieve a glass with some liquid, you should not start with an empty glass.
If you start with a filled glass, you might end with an empty glass. But the reversal is bogus: you would get coincident surface and its noise.
From right to left:
- an empty glass
- an half-filled flass
- a full glass
- something that need to be explained
Start
cylinder { ... hollow material { glas } }
Time for CSG
To make an empty glass, we now remove from the block of glass the internal volume to be filled by the air. |
difference { cylinder { ... hollow material { glas } } cylinder { ... hollow material { air } } cutaway_textures }
We hear you: "Yes, great. Nothing new under the sun so far!"
The right approach of CSG when pouring liquid
The key points to make a glass with some liquid are:
- to place the liquid inside the glass
- to remove from that block the volume where the air is to be
Caveat about the shapes of liquid and air
The coincident surface's noise appears as soon as two identical surfaces share an area.
As a consequence, the shape of the air and the shape of the liquid must share only, on their surface, a common line.
There is no reason for the shape of glass to ever meet the shape of the liquid (or only in the part removed later by the shape of air), so that's part is safe.
let me drink
difference { union { cylinder { ... hollow material { glas } } cylinder { ... hollow material { wat } } } cylinder { ... hollow material { air } } cutaway_textures hollow }