Germany, Berlin
Joined: Sep 12, 2024
Post Count: 53
Status:
Offline
Non-square textures on non-square faces
Some parts of a shelving system I want to model (Balton B III for those who like chrome and steel ;-) are from sheet metal with perforated areas, like this shelf, for instance.
My challenge is to get the hexagonal perforation pattern into SH3D.
First, I made a texture with two quarter holes (see 1st image, yellow rectangle), repeatedly mirrored along u and v in blender. However, I could not persuade SH3D of the mirroring. Then I made a non mirroring texture (green rectangle), and had it repeated in SH3D. See the rendered lower picture.
But: - Whichever image size I enter in the Texture Import Wizard - it would not let me tweak the aspect ratio, only the absolute size. The wizard enforces a numeric ratio equal to that of the source image, which cannot be square. - However, when applying the texture the tiles turn out square - no matter what numbers I have entered.
Question 1: how can I make the texture keep its proportions? - I just can't go with square tiles as my pattern demands a certain tile aspect, otherwise the pattern axes are at weird angles. Making a pre-baked texture for the whole area is not an option, because I have to "perforate" many differently sized areas on a variety of parts with the same pattern, plus the final pattern will be 9 times as fine - requiring several hundred tiles.
Question 2 (maybe another thread?): The upper and lower image use the same texture. When I change the base material's colour, in blender the entire part changes. How can I in SH3D as well keep the base colour of the material in the perforated part, i.e. ignore, or at least transform the texture's RGB values?
Originally, the texture is an SVG. I can easily derive any useful kind of pixel image.
If a potential helper wants to see the .sh3d .obj, .mtl, .png, .svg or anything else - which upload service would you recommend? - Anyway, I'd be grateful for any thought, cause I just want to do my home in SH3D for its excellent fitness for the purpose and ease of use.
Forgive me if I was just too blind to see the obvious. (Newbie)
----------------------------------------
Cheers - Joe //
Netherlands
Joined: Apr 8, 2022
Post Count: 1175
Status:
Offline
Re: Non-square textures on non-square faces
Correct texturing is one of the most difficult things in both Blender and Sweet Home 3D, actually in any 3D modelling software. You created some clever tiles that repeat seamless but you are right, Sweet Home 3D repeats square tiles. That's why I always create a square image for a texture that has to be repeated and used in Sweet Home 3D. In your case this is not possible so another solution is needed. I can think of three possibilities. 1 - Create an image large enough to span your largest object. Using an image editor like GIMP you can cut out images with the sizes of each of the parts that needs a perforation texture. A single image at the default 100% scaling will span the size of the object thus retaining the cut out image that will not stretch holes. 2 - Create an object the size of you tile. One tile will correctly fill the top like I stated in option 1. Then repeat the object instead of the tiles. The Multiplier plugin is your friend to quickly create strings of objects (first repeat objects into a row, then repeat the row). For size efficiency you can use a box with all sides except the top invisible. Export and import that 'box' and it is much smaller, important when you repeat it hundreds of times. You can then use those objects as is or export a set together to create a single object. In other words: create a single face object (box top) textured with your tile. Then use repeated 'top faces' to create the larger object. 3 - A completely different approach that creates real holes but the result will be a huge object in both object size and rendering time. On the other hand, you get real perforation! If you want to go that way I can explain how to do that.
Option 2 is probably your best option unless you want to go for real perforation.
---------------------------------------- Dodecagon.nl 800+ 3D models, manuals, and projects
Germany, Berlin
Joined: Sep 12, 2024
Post Count: 53
Status:
Offline
SOLVED: Non-square textures on non-square faces
Keet,
First of all thank you for the prompt, comprehensive and comprehensible reply! Suggestion 2 is it. You may stop reading here. The rest is only my afterthoughts for the interested.
#3 is the easiest to make, as I model the geometry in FreeCAD. The number of arrayed holes can even be parametric there, thus controlled by the respective variant of my part. But I have only a core i5 and 8 GB RAM , no Cray
#1 is what I had figured myself soon after I had posted. But wouldn't the texture image be huge? My largest part would require 4 MPx for distinguishable holes, and the project may contain many shelves. What is most expensive? - Mapped texels while rendering (i.e. after repeating the texture tile), or actually rendered texels (renderer might skip obscured or simplify too far texels), or source pixels loaded from the texture's origin?
My #1.5: The ideal aspect ratio of the tile is 1/√3 in my case; 15/26 comes close enough - indeed the Px size of my texture. Now, I might make a "meta-"tile of 26 x 15 base tiles, yielding a 390 x 390 Px square which suits SH3D.
#2 made me smack my forehead for why I haven't found it myself. The definition of the target area is already defined in the CAD model by a "stencil". All it takes is replacing that by an array of stencils. This costs only 2 triangles per hole pair (in contrast to 56 in #3, circles already simplified to hexagons).
Thanks for that really new approach!
----------------------------------------
Cheers - Joe //
Italy
Joined: Nov 17, 2021
Post Count: 439
Status:
Offline
Re: SOLVED: Non-square textures on non-square faces
Here is another solution. You may have already found that tiling works perfectly when the texture is applied to a wall or floor (room). You may model your shelves using walls or rooms, and then export them as obj and import them back as furniture.
Italy
Joined: Nov 17, 2021
Post Count: 439
Status:
Offline
Re: SOLVED: Non-square textures on non-square faces
P.S. If you want to generate real holes in SH3D you may use a wall (or room) as base model, put there a transparent round window (or staircase), and use the multiplier plugin to fill the area. The plugin can multiply even more than one object in one shot, so you can place 2 windows at 50% offset to get the pattern in the picture you posted.
----------------------------------------
[Edit 1 times,
last edit by Daniels118 at Oct 16, 2024, 6:53:24 AM]
Netherlands
Joined: Apr 8, 2022
Post Count: 1175
Status:
Offline
Re: SOLVED: Non-square textures on non-square faces
Daniels118 is right, if you use a wall or a floor then the texturing is not changed to squares, that might be a good solution for you.
Some tricky things to remember when you use a wall: ⚫ A (new) project with no levels added exports a wall with the exact height you gave the wall. ⚫ The same project with a level added above and the same wall on level 0 will export with it's height + 0.1cm. ⚫ A wall on any level that has a level beneath it will export with it's height + the floor thickness.
When you use a floor: ⚫ Make sure you uncheck the ceiling checkbox before export ⚫ With no levels added the resulting object will have a height of 0, i.e a single flat face. Perfect as a 'texture' for what you want. ⚫ In the 2D view the quality of the resulting floor texture is not that good compared to the display quality on a wall. In the 3D view and rendered photo's there is no quality difference. ⚫ You can use a floor (room) as is, so without exporting, but you will have to add a level for each shelf height to get the elevation of the floor. Make sure you use a floor thickness with the thickness of the shelf and uncheck the ceiling checkbox. To add a border you will have to add that to the level below the floor and elevate it so it levels with the top of the floor. This is a cumbersome method but it probably puts the least pressure on your system resources since only a single texture tile is repeatedly used where exported floors each get their own texture image.
⚫ When rendering a photo there is a little difference between wall/floor but not in the sharpness of the texture, mainly in the coloring.
You will have to try it to see what fits your purpose best.
---------------------------------------- Dodecagon.nl 800+ 3D models, manuals, and projects
Germany, Berlin
Joined: Sep 12, 2024
Post Count: 53
Status:
Offline
Re: SOLVED: Non-square textures on non-square faces
Wow - I am impressed by the many tricks and tips I'm getting.
@Daniels118: No, I did not know...
[...]that tiling works perfectly when the texture is applied to a wall or floor (room).
It's intriguing, maybe lets me skip the blender step. Regarding SH3D I'm really a newbie. I come from CAD.
I'd like to keep all geometry inside the CAD model as that's where I go for dimensional accuracy and parametric modelling. In SH3D I'm only seeking a visualization good enough to to keep me from re-arranging bulky real furniture more than twice in a row just for their appearance. So I'll leave the real-holes-using-multiplyer approach.
@Keet: THX again for the "bullets" - they save me at least a day of figuring it all by myself. I will try, see and know what works how.
----------------------------------------
Cheers - Joe //