Netherlands
Joined: Apr 8, 2022
Post Count: 1442
Status:
Offline
Re: Terrain Generator plug-in
Emmanuel, a nice and very welcome addition to the Terrain Generator would be an option to start with an overall elevation at a set height. I'll explain why:
Besides creating elevations like hills and mountains the Terrain Generator is also used to create depressions for ponds or lakes. This is of course done by elevating everything that is not a depression in the terrain. And that's a tedious and always inaccurate process. It also seems like working backward. If you can start with a clean elevated terrain at a set height it allows you to immediately start with lowering the places where you want depressions and still raise where you want hills.
The result is that (placed at a level -<max height>) you still can have your mostly original flat surface except now with the depression for the pond or lake without having to go through the process of raising most of the surface. Such an option shouldn't be too difficult to implement because it's basically what you do with your mouse except now it's set with a predefined height for the full room instead of raising a point with magnetism. Of course once the filled height is set you can freely adjust up and down, it's just a much more convenient start position than everything at level 0.
Any possibility this can be implemented?
Keet
---------------------------------------- Dodecagon.nl 1300+ 3D models, manuals, and projects
France
Joined: Nov 7, 2005
Post Count: 9430
Status:
Offline
Re: Terrain Generator plug-in
You should set a very large influence radius to elevate all the points at the same elevation as shown in this video.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Netherlands
Joined: Apr 8, 2022
Post Count: 1442
Status:
Offline
Re: Terrain Generator plug-in
Thank you Emmanuel for the fast reply.
I know and I have seen the video but that still doesn't set the elevation at a flat height and it's very difficult to get a specific height, for example a specific wall height. I tried it with a scale 100000 and in some spaces it still wasn't flat enough for a building.
Terrains almost by definition are large (i.e. terrain size, not house size). That makes it very slow. Splitting in multiple rooms also makes no difference because you have to see them together. I currently have a terrain the size of 294mx194m and wanted to have a (partial) lake in a corner of the terrain. It's mostly flat (because of multiple buildings) but does have a few elevations scattered around. Trying to get what I explained proved to be virtually impossible to do.
As usual I found ways around the problem. Not as nice as a full terrain would be but it is what it is. I still think it would be a useful and (I think) fairly easy addition to the Terrain Generator.
Keet
---------------------------------------- Dodecagon.nl 1300+ 3D models, manuals, and projects
France
Joined: Nov 7, 2005
Post Count: 9430
Status:
Offline
Re: Terrain Generator plug-in
You’ll see that I don’t like to add some fields everywhere. It’s not the problem of whether it’s simple to program or not. In your case, I prefer to increase the max value of influence radius if that’s enough. And about entering precise elevations, be patient, it should be available sooner that you think. But shh! I don’t like to announce coming features…
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Netherlands
Joined: Apr 8, 2022
Post Count: 1442
Status:
Offline
Re: Terrain Generator plug-in
Well, you can't say I'm not persistent, so I cheated.
For those who want to start with an equal elevation like I explained:
1. Create the room. 2. Switch off ceiling. 3. Optionally set a color or texture. 4. Select the room and start the Terrain Generator. 5. Set the expansion scale to 100000. 6. With the Shift key raise everything to a level >0. 7. Generate the terrain (OK button). 8. Save your Plan.
So far just like creating a normal terrain.
Now the 'cheating': 1. Unzip the SH3D file (you might need to add a zip extension first). 2. Make a copy of the Home.xml file in the unzipped directory to a working directory. 3. Open the the copied file and replace the value part on every line with "terrainElevationAt" with a value "250.000". 250 is the height, set it to the height you want. Since this can be a lot of lines (300000+ for me) I wrote a little Python routine to do this. 4. Save the file and copy it to the previously unzipped directory (overwriting the original file). 5. Zip all the files in your unzipped directory and remove the .zip extension from the resulting zip file. This should leave you with the original .sh3d file but with the changed Home.xml file. 6. Open the updated .sh3d file with SH3D and remove the terrain object (NOT the room!). 7. Select the room and start the Terrain Generator again. 8. You now have a terrain set at the height 250 and you can depress or raise parts to create a new terrain. 9. Save the terrain with OK button and you get a new terrain object.
Keet
---------------------------------------- Dodecagon.nl 1300+ 3D models, manuals, and projects
Netherlands
Joined: Apr 8, 2022
Post Count: 1442
Status:
Offline
Re: Terrain Generator plug-in
Emmanuel, when you get to adding features to the Terrain Generator please consider these:
1. A highlighted point where the mouse is on the terrain. Currently it's a huge guess where elevation will occur on large terrains. Sometimes far from where you thought you clicked.
2. At least a single level of undo (if that doesn't cause memory problems)
3. Pan left/right and up/down This makes it easier to zoom into where you want, especially with larger terrains.
4. Keyboard keys to rotate/tilt and pan. If you zoom in to far you can no longer place the mouse at the side to do that. I would suggest the arrow keys for rotate/tilt and ctrl+arrow keys for panning.
5. Elevation accuracy: if you can't zoom in far enough you have very little control over how much elevation a mouse movement will trigger.
6. Set a max height: this so you can limit elevation to, for example, a wall height from where it slopes down. Without reasonable accuracy this is currently very difficult. This would also solve 'starting with a set elevation': set the max and lift everything to that height.
I'm looking forward to see any or all in a next version!
Keet
---------------------------------------- Dodecagon.nl 1300+ 3D models, manuals, and projects
France
Joined: Nov 7, 2005
Post Count: 9430
Status:
Offline
Re: Terrain Generator plug-in
Here's the version 1.2 of the Terrain Generator plug-in which provides the following improvements: - Magnetism was renamed as Multiple points and Alignment as Row modification - Multiple points and Row modification states can also be toggled with check boxes (keyboard shortcuts still available) - Undo / Redo buttons lets you undo / redo local changes (with 100 possible undo operations) - The elevated grid point remains selected at screen after mouse button is released - Elevation is editable to fine tune values - It's possible to copy the current elevation on other points with a right click (or ctrl + click under macOS) - When you draw a closed space with the right mouse button pressed (finishing on the point where you started), a dialog box is displayed to confirm whether all points within this space should be elevated (see demo video – 5 MB) - Performances while elevating points were greatly improved - The rotation around the vertical axis is done at the closest degree - The length unit used in Influence radius spinner was fixed.
Hope this will satisfy most requests
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Netherlands
Joined: Apr 8, 2022
Post Count: 1442
Status:
Offline
Re: Terrain Generator plug-in
Thank you! I'll be experimenting with this quite a lot the coming days.
---------------------------------------- Dodecagon.nl 1300+ 3D models, manuals, and projects
Italy
Joined: Nov 17, 2021
Post Count: 474
Status:
Offline
Re: Terrain Generator plug-in
Hi Emmanuel, thank you for this new version! I have added it to the Plugin manager too.
A small bug (at least on Windows): when using the Alt and Shift keys to toggle the options, the checkbox is toggled on musedown, but it is toggled again on mouseup. Holding the key does not work (the checkbox blinks crazly).
Few suggestion for future improvements:
Add incremental mode, i.e. add a value (instead of override) to the current elevation while moving the mouse over the grid. (It should be allowed to set negative values too to dig the terrain).
Add smooth tool, would be helpful in conjunction with the new closed space function.
Netherlands
Joined: Apr 8, 2022
Post Count: 1442
Status:
Offline
Re: Terrain Generator plug-in
(It should be allowed to set negative values too to dig the terrain).
Negative values are impossible since the terrain is generated from a room which is by default at elevation 0 on a level. Just like walls can't have a negative elevation. That's why I requested the option to first raise the whole room to a single height after which you can lower parts.
Just create a level below your ground floor, lets say -250 and with a height of 250. Create the room and start the Terrain Generator. With a large scale and row modification lift everything above a 250 height. While you still see the blue point change the elevation value to 250 and you have a terrain evenly raised at 250 and level with your original ground level. Now you can both lower and raise the parts you want.
One 'bug' I noticed: After creating the terrain, walls that should show above the terrain (i.e. are higher than the terrain elevation) don't show in the 2D view but do in the 3D view. Not showing in the 2D view forces you to make the Terrain object invisible before you can do anything else simply because everything is otherwise hidden below the terrain. In my example with a 250 high terrain I had walls of 350 high for testing purposes that should have broken through the surface of the terrain and be visible but they don't. I understand that is the way with all objects, maybe something like a 'Move to back' like in other programs that have overlapping objects is possible. I'm thinking about when you group objects: put a vase on a table and sometimes the vase doesn't show in the 2D view. Cut the vase and paste again and after regrouping it does show. So it depends on the order in which the objects are 'stacked'. Something should be possible with that knowledge but the same 'trick' doesn't work with the walls.
---------------------------------------- Dodecagon.nl 1300+ 3D models, manuals, and projects