Sticker with other than rectangular shape

Sticker with other than rectangular shape
#1
Hi all,

How would one create a sticker (using texture mapping) with another than a rectangular shape?
Like for example the stickers that come with set 42061

The ones that go on the sides of the bucket. I guess that could also be done with LDraw geometry.

And how about sticker no. 4 that goes on a technic panel which itself has a irregurar and curved surface.

I can create the images, but fail to see how a (and if) a sticker can be made.

Any thoughts?

Thanks.

Jaco
Jaco van der Molen
lpub.binarybricks.nl
RE: Sticker with other than rectangular shape
#2
(2018-12-12, 14:31)Jaco van der Molen Wrote: How would one create a sticker (using texture mapping) with another than a rectangular shape?
Like for example the stickers that come with set 42061
The problem with the non-rectangular shape is relatively simple... it is much mode tricky if the sticker is not flat! You have indeed to first create the 3D shape of the sticker and make the image projection on it. Problem is that the non flat projection may introduce distortions in the image - or rather, the image must be a pre-distorted flat projection of the shaped sticker. In your case even the panel is flat enough, so distortion is not a real issue.

For an example, see my EV3 stickers! http://www.ldraw.org/cgi-bin/ptscan.cgi?...mindstorms
RE: Sticker with other than rectangular shape
#3
(2018-12-12, 14:53)Philippe Hurbain Wrote:
(2018-12-12, 14:31)Jaco van der Molen Wrote: How would one create a sticker (using texture mapping) with another than a rectangular shape?
Like for example the stickers that come with set 42061
The problem with the non-rectangular shape is relatively simple... it is much mode tricky if the sticker is not flat! You have indeed to first create the 3D shape of the sticker and make the image projection on it. Problem is that the non flat projection may introduce distortions in the image - or rather, the image must be a pre-distorted flat projection of the shaped sticker. In your case even the panel is flat enough, so distortion is not a real issue.

For an example, see my EV3 stickers! http://www.ldraw.org/cgi-bin/ptscan.cgi?...mindstorms
Is there a tool you can recommend when it is for a non-flat surface? I thought the non-planar TEXMAP modes were able to help with this without the sticker author having to take it into account.
RE: Sticker with other than rectangular shape
#4
(2018-12-12, 18:27)Lasse Deleuran Wrote: I thought the non-planar TEXMAP modes were able to help with this without the sticker author having to take it into account.

Yes you can switch to e.g. spherical mode when the surface is closer to it, but whenever the intended surface is very irregular you'll (if you are a perfectionist) need to compensate the texture for it.

There are tools to automate this, especially in the game modelling world.

e.g. blender might offer solutions for this.

ps: also even with e.g. spherical mode you need to compensate your texture for it, the best known example of this being a world map.
RE: Sticker with other than rectangular shape
#6
(2018-12-12, 14:53)Philippe Hurbain Wrote:
(2018-12-12, 14:31)Jaco van der Molen Wrote: How would one create a sticker (using texture mapping) with another than a rectangular shape?
Like for example the stickers that come with set 42061
The problem with the non-rectangular shape is relatively simple... it is much mode tricky if the sticker is not flat! You have indeed to first create the 3D shape of the sticker and make the image projection on it. Problem is that the non flat projection may introduce distortions in the image - or rather, the image must be a pre-distorted flat projection of the shaped sticker. In your case even the panel is flat enough, so distortion is not a real issue.

For an example, see my EV3 stickers! http://www.ldraw.org/cgi-bin/ptscan.cgi?...mindstorms

OK, I see.
Very impressive work Philo!
Is there a sticker there that is applicable for panel part 87080 that is used in the telehandler?

Edit: studying the files from Philo on the PT tells me there is no panel 87080 in the EV3 set ;-(
However, I see now how it is done with the sickers.
I do not have the skills to make the LDraw geometry surface and subfiles for the panel I need, but perhaps Philo can make that? :-)

I do have the skills and tools to create the image for the sticker though.

Can we make something more general for these kind of parts?
I mean standard "blank" LDraw surfaces for stickers that are used.
I think there are more technic sets for example that have stickers applied to panels.
Jaco van der Molen
lpub.binarybricks.nl
RE: Sticker with other than rectangular shape
#5
It might not be obvious from the other responses, but textures only get applied to the geometry inside the !TEXMAP START/END group. (For !TEXMAP NEXT, the texture is only applied to the next line of LDraw geometry.) This means that even though the image is rectangular, since it only shows up on the specified geometry, it can quite easily be mapped onto a non-rectangular flat sticker.

Others have already pointed out distortions that can appear when the geometry being mapped is non-flat.
RE: Sticker with other than rectangular shape
#7
(2018-12-12, 20:50)Travis Cobbs Wrote: It might not be obvious from the other responses, but textures only get applied to the geometry inside the !TEXMAP START/END group. (For !TEXMAP NEXT, the texture is only applied to the next line of LDraw geometry.) This means that even though the image is rectangular, since it only shows up on the specified geometry, it can quite easily be mapped onto a non-rectangular flat sticker.

Others have already pointed out distortions that can appear when the geometry being mapped is non-flat.

OK, so for the flat stickers applied to the side of the bucket in this set, you'd have to create a circular LDraw geometry object on which the image of the sticker can be projected?

How? Can someone help with that?
Jaco van der Molen
lpub.binarybricks.nl
RE: Sticker with other than rectangular shape
#8
(2018-12-13, 9:24)Jaco van der Molen Wrote:
(2018-12-12, 20:50)Travis Cobbs Wrote: It might not be obvious from the other responses, but textures only get applied to the geometry inside the !TEXMAP START/END group. (For !TEXMAP NEXT, the texture is only applied to the next line of LDraw geometry.) This means that even though the image is rectangular, since it only shows up on the specified geometry, it can quite easily be mapped onto a non-rectangular flat sticker.

Others have already pointed out distortions that can appear when the geometry being mapped is non-flat.

OK, so for the flat stickers applied to the side of the bucket in this set, you'd have to create a circular LDraw geometry object on which the image of the sticker can be projected?

How? Can someone help with that?

Well, it's not exactly trivial, but neither is it too complicated. You need to manually create a flat surface that is the shape of the sticker, then store this in a subpart. In the sticker part, have a !TEXMAP line with the appropriate texture coordinates, and have a reference to the subpart be the only geometry that is textured. Then, have a second reference to the surface (not textured), with BFC INVERNEXT, and offset by 0.25 LDU to represent the back of the sticker. Finally, add quads around the edges between the two surfaces.
RE: Sticker with other than rectangular shape
#9
(2018-12-13, 18:13)Travis Cobbs Wrote:
(2018-12-13, 9:24)Jaco van der Molen Wrote: OK, so for the flat stickers applied to the side of the bucket in this set, you'd have to create a circular LDraw geometry object on which the image of the sticker can be projected?

How? Can someone help with that?

Well, it's not exactly trivial, but neither is it too complicated. You need to manually create a flat surface that is the shape of the sticker, then store this in a subpart. In the sticker part, have a !TEXMAP line with the appropriate texture coordinates, and have a reference to the subpart be the only geometry that is textured. Then, have a second reference to the surface (not textured), with BFC INVERNEXT, and offset by 0.25 LDU to represent the back of the sticker. Finally, add quads around the edges between the two surfaces.

OK, I understand and studying the files (for the EV3 panesl) from Philo I see how it is done.
Still, creating the geometry for these stickers seems too complicated for me.

What tool would be best to make this?
I found this thread https://forums.ldraw.org/thread-22776.html using LD Pattern Creator. Could that be of use?
I also know LDPartEditor from Nils, but can't get that to work due to missing Java on my PC.
Jaco van der Molen
lpub.binarybricks.nl
RE: Sticker with other than rectangular shape
#10
(2018-12-14, 8:07)Jaco van der Molen Wrote: I found this thread https://forums.ldraw.org/thread-22776.html using LD Pattern Creator. Could that be of use?
Actually that thread mostly speaks of LDPE. LDPC is great to create the basic flat shape of sticker, but to go 3D LDPE is the tool of choice.
Quote:I also know LDPartEditor from Nils, but can't get that to work due to missing Java on my PC.
You can't install Java, or you don't want to do it (eg. for security reasons)?
RE: Sticker with other than rectangular shape
#11
(2018-12-14, 10:02)Philippe Hurbain Wrote: You can't install Java, or you don't want to do it (eg. for security reasons)?

I have Java installed:

java version "1.8.0_40"
Java™ SE Runtime Enviroment (build 1.8.0_40-b26)
Java HotSpot™ Client VM (build 24.40-b25, mixed mode, sharing)

This is on my PC at work, which is Windows 7, 64b system, but this might not be the right version. I'll have to update.

On my laptop at home, windows 10, I did install the latest (I guess) version of Java, but still LDPE tells me Java is not installed or not ran properly...
Jaco van der Molen
lpub.binarybricks.nl
RE: Sticker with other than rectangular shape
#12
(2018-12-14, 11:13)Jaco van der Molen Wrote: I now have Java installed:

java version "1.8.0_40"
Java™ SE Runtime Enviroment (build 1.8.0_40-b26)
Java HotSpot™ Client VM (build 24.40-b25, mixed mode, sharing)

I'll have to update.

Ok, so I updated Java and using the cmd prompt java - verision now says

java version "1.8.0_191"
Java™ SE Runtime Enviroment (build 1.8.0_191-b12)
Java HotSpot™ Client VM (build 25.191-b12, mixed mode)

Still, LDPE won´t run.... :-(
Jaco van der Molen
lpub.binarybricks.nl
RE: Sticker with other than rectangular shape
#13
(2018-12-14, 11:21)Jaco van der Molen Wrote:
(2018-12-14, 11:13)Jaco van der Molen Wrote: I now have Java installed:

java version "1.8.0_40"
Java™ SE Runtime Enviroment (build 1.8.0_40-b26)
Java HotSpot™ Client VM (build 24.40-b25, mixed mode, sharing)

I'll have to update.

Ok, so I updated Java and using the cmd prompt java - verision now says

java version "1.8.0_191"
Java™ SE Runtime Enviroment (build 1.8.0_191-b12)
Java HotSpot™ Client VM (build 25.191-b12, mixed mode)

Still, LDPE won´t run.... :-(
Have you installed the 64bit version? (required by LDPE, but tricky to find on Oracle website) https://www.oracle.com/technetwork/java/...53423.html
RE: Sticker with other than rectangular shape
#14
(2018-12-14, 12:16)Philippe Hurbain Wrote:
(2018-12-14, 11:21)Jaco van der Molen Wrote: Ok, so I updated Java and using the cmd prompt java - verision now says

java version "1.8.0_191"
Java™ SE Runtime Enviroment (build 1.8.0_191-b12)
Java HotSpot™ Client VM (build 25.191-b12, mixed mode)

Still, LDPE won´t run.... :-(
Have you installed the 64bit version? (required by LDPE, but tricky to find on Oracle website) https://www.oracle.com/technetwork/java/...53423.html

Yes, but, silly me: I had to restart my PC in order for it to work.
So I got LDPE to work. I started (re)working some of my custom parts...
Tnx.
Jaco van der Molen
lpub.binarybricks.nl
RE: Sticker with other than rectangular shape
#15
(2018-12-13, 18:13)Travis Cobbs Wrote:
(2018-12-13, 9:24)Jaco van der Molen Wrote: OK, so for the flat stickers applied to the side of the bucket in this set, you'd have to create a circular LDraw geometry object on which the image of the sticker can be projected?

How? Can someone help with that?

Well, it's not exactly trivial, but neither is it too complicated. You need to manually create a flat surface that is the shape of the sticker, then store this in a subpart. In the sticker part, have a !TEXMAP line with the appropriate texture coordinates, and have a reference to the subpart be the only geometry that is textured. Then, have a second reference to the surface (not textured), with BFC INVERNEXT, and offset by 0.25 LDU to represent the back of the sticker. Finally, add quads around the edges between the two surfaces.

OK, so I tried to create the first surface and texmapped it lik this:

Code:
```0 Set 42061 - Sticker 1 0 UNOFFICIAL PART 0 BFC CERTIFY CCW 0 !TEXMAP START PLANAR   -37 0 0 37 0 0 -37 0 -47   42061stk01.png 0 !: 1 16 0 0 -10 37 0 -1.87226e-005 0 -1 0 -1.87226e-005 0 -37 2-4disc.dat 0 !: 4 16 37 0 0 37 0 -10 -37 0 -10 -37 0 0 0 !TEXMAP FALLBACK 1 16 0 0 -10 37 0 -1.87226e-005 0 -1 0 -1.87226e-005 0 -37 2-4disc.dat 4 16 37 0 0 37 0 -10 -37 0 -10 -37 0 0 0 !TEXMAP END```

It does not work. What is wrong here?
This is the image

Jaco van der Molen
lpub.binarybricks.nl
RE: Sticker with other than rectangular shape
#16
(2018-12-14, 19:35)Jaco van der Molen Wrote: It does not work. What is wrong here?

It works for me but its only visible from one side and seems a bit wrangled.

The coordinates look off (especially the scientific notation ones)

I cleaned it a bit up and added a backside and partial sides:

Code:
```0 Set 42061 - Sticker 1 0 UNOFFICIAL PART 0 BFC CERTIFY CCW 0 !TEXMAP START PLANAR   -37 0 0   37 0 0   -37 0 -47   42061stk01.png 1 16   0 0 -10    36 0 0      0 -1 0       0 0 -27    48/2-4disc.dat 4 16   36 0  0    36 0 -10   -36 0 -10    -36 0  0 0 !TEXMAP END 0 BFC INVERTNEXT 1 16   0 -1 -10    36 0 0      0 -1 0       0 0 -27    48/2-4disc.dat 4 16   -36 -1  0   -36 -1 -10   36 -1 -10  36 -1  0   1 16   0 0 -10    36 0 0      0 -1 0       0 0 -27    48/2-4cyli2.dat```

edit: Changed some 37's into 36's
RE: Sticker with other than rectangular shape
#17
(2018-12-14, 20:19)Roland Melkert Wrote:
(2018-12-14, 19:35)Jaco van der Molen Wrote: It does not work. What is wrong here?

It works for me but its only visible from one side and seems a bit wrangled.

The coordinates look off (especially the scientific notation ones)

I cleaned it a bit up and added a backside and partial sides:

Code:
```0 Set 42061 - Sticker 1 0 UNOFFICIAL PART 0 BFC CERTIFY CCW 0 !TEXMAP START PLANAR   -37 0 0   37 0 0   -37 0 -47   42061stk01.png 1 16   0 0 -10    36 0 0      0 -1 0       0 0 -27    48/2-4disc.dat 4 16   36 0  0    36 0 -10   -36 0 -10    -36 0  0 0 !TEXMAP END 0 BFC INVERTNEXT 1 16   0 -1 -10    36 0 0      0 -1 0       0 0 -27    48/2-4disc.dat 4 16   -36 -1  0   -36 -1 -10   36 -1 -10  36 -1  0   1 16   0 0 -10    36 0 0      0 -1 0       0 0 -27    48/2-4cyli2.dat```

edit: Changed some 37's into 36's

OK, works now for me too. It seems to project the image on the back?
As can see in the screenshot below the image is not visable in the part bin if the part is drawn at this angle.

The thickness of a sticker is 0.25 LDU, right?
So the 2-4cyli2 you added should be 0.25 high.
And I think we can use the box4-1.dat primitive to close things up, right?

We're getting close, though the form is not right too and the sticker is too small at the rectangular part.

The reason I am going through all this effort is that I am trying to recreate the original instructions for the set with LPub3D as much as possible.
Progress so far: https://drive.google.com/open?id=1Fbv-Pz...5GljS0qKrL (has some errors to be fixed)
Jaco van der Molen
lpub.binarybricks.nl
RE: Sticker with other than rectangular shape
#18
Apart from the learning experience, why go all the way to a texmap on such a simple pattern?
Keep in mind that you should also create a fallback pattern on the top surface with, in this case, the same red/white areas.

Yes, any sticker is always only 0.25 ldu thick.

You should not use the cyli2 primititves. Stickers with a rounded surface should have condlines. Use a regular cyli prim.
No, you can't use the box4-1 primitive, since it contains edgelines.
A sticker should never have any edge lines, but allways condlines.
(unless it is a formed sticker folded around a sharp corner. Then an edge is allowed).
RE: Sticker with other than rectangular shape
#19
(2018-12-15, 10:36)Magnus Forsberg Wrote: Apart from the learning experience, why go all the way to a texmap on such a simple pattern?
Keep in mind that you should also create a fallback pattern on the top surface with, in this case, the same red/white ares.

Yes, any sticker is always only 0.25 ldu thick.

You should not use the cyli2 primititves. Stickers with a rounded surface should have condlines. Use a regular cyli prim.
No, you can't use the box4-1 primitive, since it contains edgelines.
A sticker should never have any edge lines, but allways condlines.
(unless it is a formed sticker folded around a sharp corner. Then an edge is allowed).

I know. But it was something I was curious about.
Perhaps I will create it wit LDraw geometry since I am learning that too.
Thanks for the tips.
Jaco van der Molen
lpub.binarybricks.nl
RE: Sticker with other than rectangular shape
#20
(2018-12-15, 11:30)Jaco van der Molen Wrote: Perhaps I will create it wit LDraw geometry since I am learning that too.
Definitely, a flat sticker with simple geometric pattern like this one should be done using LDraw geometry. It's another story if the pattern is complex, or if the sticker is not flat. In the later case, even for simple patterns, both methods have benefits and drawbacks. LDraw geometry is crisper but can look faceted, and yields surface smoothing artifacts. Texmap (with reasonably sized images) look a bit fuzzy, but smoothing looks as good as unpatterned shape.

Quote:Progress so far: https://drive.google.com/open?id=1Fbv-Pz...5GljS0qKrL (has some errors to be fixed)
Extremely nice BIs!!!
RE: Sticker with other than rectangular shape
#21
Philippe Hurbain
(2018-12-15, 11:30)Jaco van der Molen Wrote: Perhaps I will create it wit LDraw geometry since I am learning that too.
Definitely, a flat sticker with simple geometric pattern like this one should be done using LDraw geometry. It's another story if the pattern is complex, or if the sticker is not flat. In the later case, even for simple patterns, both methods have benefits and drawbacks. LDraw geometry is crisper but can look faceted, and yields surface smoothing artifacts. Texmap (with reasonably sized images) look a bit fuzzy, but smoothing looks as good as unpatterned shape.

Quote:Progress so far: https://drive.google.com/open?id=1Fbv-Pz...5GljS0qKrL (has some errors to be fixed)
Extremely nice BIs!!!

Thanks!
I made some progress again and created the stickers for the bucket with LDraw geometry.

@Philo: are you perhaps willing to create the geometry for the sticker on the technic panel, like you did for EV3?

Jaco van der Molen
lpub.binarybricks.nl
RE: Sticker with other than rectangular shape
#22
(2018-12-18, 8:53)Jaco van der Molen Wrote: @Philo: are you perhaps willing to create the geometry for the sticker on the technic panel, like you did for EV3?
Yes I'll do... Pretty useful as this sticker shape is used in many sets!
RE: Sticker with other than rectangular shape
#23
(2018-12-18, 10:20)Philippe Hurbain Wrote:
(2018-12-18, 8:53)Jaco van der Molen Wrote: @Philo: are you perhaps willing to create the geometry for the sticker on the technic panel, like you did for EV3?
Yes I'll do... Pretty useful as this sticker shape is used in many sets!

Great!
Shall we perhaps create some "png image templates" for these kinds of stickers? Would that be useful?
Jaco van der Molen
lpub.binarybricks.nl
RE: Sticker with other than rectangular shape
#24
(2018-12-18, 10:20)Philippe Hurbain Wrote:
(2018-12-18, 8:53)Jaco van der Molen Wrote: @Philo: are you perhaps willing to create the geometry for the sticker on the technic panel, like you did for EV3?
Yes I'll do... Pretty useful as this sticker shape is used in many sets!

The instructions are "done".
I've done these to showcase and test LDraw / LDCad / LPub3D features.
Attached is the model file too.

The only thing missing is the sticker on the panel, but Philo is working on that ;-)

Attached Files
Jaco van der Molen
lpub.binarybricks.nl
RE: Sticker with other than rectangular shape
#25
(2018-12-18, 8:53)Jaco van der Molen Wrote: @Philo: are you perhaps willing to create the geometry for the sticker on the technic panel, like you did for EV3?
Stickers subparts are done now!
http://www.ldraw.org/cgi-bin/ptscan.cgi?q=87080
Rough test stickers attached (file headers are wrong, length of image is a bit approximate). I suggest you to make background of image completely red to avoid little inaccuracies in corners (kind of "full-bleed printing")

Attached Files
RE: Sticker with other than rectangular shape
#26
(2018-12-19, 14:33)Philippe Hurbain Wrote: I suggest you to make background of image completely red to avoid little inaccuracies in corners (kind of "full-bleed printing")

I did that and attached the updated image. (I also cleaned up one of the top curves.)

RE: Sticker with other than rectangular shape
#27
(2018-12-19, 14:33)Philippe Hurbain Wrote:
(2018-12-18, 8:53)Jaco van der Molen Wrote: @Philo: are you perhaps willing to create the geometry for the sticker on the technic panel, like you did for EV3?
Stickers subparts are done now!
http://www.ldraw.org/cgi-bin/ptscan.cgi?q=87080
Rough test stickers attached (file headers are wrong, length of image is a bit approximate). I suggest you to make background of image completely red to avoid little inaccuracies in corners (kind of "full-bleed printing")

OK, many thanks Philo.
However, the flat sticker is OK, but image on the formed sticker does not fit.
Can you take a look?
Jaco van der Molen
lpub.binarybricks.nl
RE: Sticker with other than rectangular shape
#28
(2018-12-20, 7:16)Jaco van der Molen Wrote:
(2018-12-19, 14:33)Philippe Hurbain Wrote: Stickers subparts are done now!
http://www.ldraw.org/cgi-bin/ptscan.cgi?q=87080
Rough test stickers attached (file headers are wrong, length of image is a bit approximate). I suggest you to make background of image completely red to avoid little inaccuracies in corners (kind of "full-bleed printing")

OK, many thanks Philo.
However, the flat sticker is OK, but image on the formed sticker does not fit.
Can you take a look?
Old LDDP save bug... Here is the right one!

Attached Files
RE: Sticker with other than rectangular shape
#29
(2018-12-20, 8:59)Philippe Hurbain Wrote:
(2018-12-20, 7:16)Jaco van der Molen Wrote: OK, many thanks Philo.
However, the flat sticker is OK, but image on the formed sticker does not fit.
Can you take a look?
Old LDDP save bug... Here is the right one!

Thank you. Perfect fit.