LDraw.org Discussion Forums

Full Version: "Wrapping" Tool
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Gerald Lasser Wrote:I will try something along this path, "bending" a sticker along a given line. For sure there is manual work involved as well, but for a start I think I will be fine with this low-fi approach first.
Gerald

I think that's a good approach. You can still get the exact result you want pretty easily, the algorithm will be 1,000,000 times easier to code, and most importantly, you can write an algorithm that works 100% of the time and is not fooled by floating point rounding errors, non-planar meshes, and other crazy things. :-)

(It is this "long tail" of bugs and weirdness that makes general purpose mesh algorithms in floating point so scary...)

cheers
ben
Gerald Lasser Wrote:PS: that could be a feature for Nils' Part Editor :-)

I will take this on my list, but I do not include this feature in the first release.
It is possible to do the 2D to 3D projection with my LDPatternCreator (LPC).
This process is difficult.
You have to create a template file with defined projections, like this:
Code:
```0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 {60 48; 60 -48; -60 -48; -60 48} {2 96 10; 2 0 10; 2 0 130; 2 96 130}```

where
{60 48; 60 -48; -60 -48; -60 48} {2 96 10; 2 0 10; 2 0 130; 2 96 130}
defines the projection
Interesting... I must dig deeper into this!

 got it to work!!! more later...
I looked into the templates of LDPC, the good thing there is I can use it to slice it first with the CUT command in the template. The problem is if the planes are approaching 90° compared to the initial orientation.

What was not very clear to me was if I have a facetted surface, how to define the orientation and coordinates of the different surfaces, but looking at your example, I will give that a try as well.

so {60 48; 60 -48; -60 -48; -60 48} I understand is a quad. but what does {2 96 10; 2 0 10; 2 0 130; 2 96 130} define?
I ever thought, that the result will be stretched or deformed after doing this.

/Max
No, take the slope parts: you project from top, but create a non-stretched pattern.
Good to know :-)
I made the "Diver's Computer Pattern" with this method, but I never used it for a multi-facetted surface (like a Curved Slope) as I did not know how to prepare a template for such a surface.
Quote:so {60 48; 60 -48; -60 -48; -60 48} I understand is a quad. but what does {2 96 10; 2 0 10; 2 0 130; 2 96 130} define?
The first part defines the area in LPC plane (quad) that will be mapped it 3D world on the quad whose coordinated are given in the second part.

I just created a template for a 6005 sticker, here is the method I used.
- Create the top surface of formed sticker, using front surface of 6005 part (file 6005StickerTemplateBase.dat)
- Inline every primitives and leave only required lines (file 6005StickerTemplate.dat)
- Launch LPC, and File -> import from dat -> project on XY front -> import projection data -> select 6005StickerTemplate.dat
- We now see the shape of sticker, with quads forming the curve getting flatter and flatter (and more and more useless...) as we approach top of curve. Thansform this imported projection data into a template: File -> projection data->template (the green lines turn light brown.
- This creates a template file, named _New_Template_1.txt (number may change if you repeat this process!). This file is located in C:\Documents and Settings\Philo\Application Data\Nils Schmidt\LDPatternCreator\template (exact location depends on Windows version).
- We are now going to transform this template to make all quads equal, with the right height, so that we can use a flat image of sticker to draw pattern. This is the painful, tedious and error prone step that would need to be automated with a script... A bit of trigonometry gives the height of each quad (5.265 ldu).
- Using this information, we change height of the quads drawn on screen by LPC
Code:
```-10 48 -10 40 10 40 10 48 CUT 10 34.74738 10 40 -10 40 -10 34.74738 CUT 10 29.5833 10 34.74738 -10 34.74738 -10 29.5833 CUT```
becomes
Code:
```-10 48 -10 40 10 40 10 48 CUT 10 34.735 10 40 -10 40 -10 34.735 CUT 10 29.47 10 34.735 -10 34.735 -10 29.47 CUT```
The first rectangle, base of part, is not part of curve and is unchanged, the second has its height slightly modified, the third has its base moved to compensate brevious quad changed, and its height changed to 5.265, and so on.
- In the same spirit, we change the planar to 3D transformation lines:
Code:
```{-10 48; -10 40; 10 40; 10 48} {10 48 -50.25; 10 40 -50.25; -10 40 -50.25; -10 48 -50.25} {10 34.747375; 10 40; -10 40; -10 34.747375} {-10 34.747375 -49.90385; -10 40 -50.25; 10 40 -50.25; 10 34.747375 -49.90385} {10 29.5833; 10 34.747375; -10 34.747375; -10 29.5833} {-10 29.5833 -48.877475; -10 34.747375 -49.90385; 10 34.747375 -49.90385; 10 29.5833 -48.877475}```
is changed to
Code:
```{-10 48; -10 40; 10 40; 10 48} {10 48 -50.25; 10 40 -50.25; -10 40 -50.25; -10 48 -50.25} {10 34.735; 10 40; -10 40; -10 34.735} {-10 34.747375 -49.90385; -10 40 -50.25; 10 40 -50.25; 10 34.747375 -49.90385} {10 29.47; 10 34.735; -10 34.735; -10 29.47} {-10 29.5833 -48.877475; -10 34.747375 -49.90385; 10 34.747375 -49.90385; 10 29.5833 -48.877475}```
- When this lengthy process is done, we save file as 6005_Sticker_Template.txtt in the template folder. Phew!
- We can now start again LPC and load this new template. All the quads of the curve now have the same height! Here is the LPC file of a quick test.

The image below shows LPC screen and resulting sticker.
[attachment=1466]
Wow! [Lifts hat] That's an amazing work you have done! Thanks!

Did a quick try on the Santa Fe Logo and it looks promising!
Pages: 1 2 3