France
Joined: Nov 7, 2005
Post Count: 9423
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: 1355
Status:
Offline
Re: Terrain Generator plug-in
Thank you! I'll be experimenting with this quite a lot the coming days.
---------------------------------------- Dodecagon.nl 1000+ 3D models, manuals, and projects
Italy
Joined: Nov 17, 2021
Post Count: 465
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: 1355
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 1000+ 3D models, manuals, and projects
France
Joined: Nov 7, 2005
Post Count: 9423
Status:
Offline
Re: Terrain Generator plug-in
Thanks for your feedback
Smoothing afterwards might be quite complicated to program to get nice results. Maybe one day…
And reordering the way things are drawn in the plan is a big development, and I’m not sure I want to change the current simple logic. You can also draw a room for your terrain which doesn’t include the walls or the house of the walls.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Netherlands
Joined: Apr 8, 2022
Post Count: 1355
Status:
Offline
Re: Terrain Generator plug-in
First of all: the new Terrain Generator is a huge improvement, great work!
And reordering the way things are drawn in the plan is a big development, and I’m not sure I want to change the current simple logic. You can also draw a room for your terrain which doesn’t include the walls or the house of the walls.
I have a path through my terrain that swings all around so I use walls to create those. Manually drawing them would be a nightmare. That a room can exist without walls is a good thing for terrain building: after creating the paths with 0.1 thick walls and creating the rooms (including the 'path room') I remove the walls and create the terrain using all rooms. The result is that I have a path with a different texture that nicely follows the terrain elevation up and down, looks great! If walls were a requirement for a room to exist that would not be possible. A test showed that a 350cm high wall hides under a 90cm high table I never realized it worked that way but it does explain why walls don't show through the terrain. It's based on elevation but doesn't take the height of the object into account for display in 2D. As a workaround I'm thinking about a way to create a top view image of the terrain and set that as the texture of the room after hiding the terrain object. It ruins the 3D view but it is a way to see the terrain contours in the 2D view while designing without hiding the walls. Or maybe an extra level 1cm higher while designing and when finished lower it to the same level. I'll have to experiment with that.
---------------------------------------- Dodecagon.nl 1000+ 3D models, manuals, and projects
Italy
Joined: Nov 17, 2021
Post Count: 465
Status:
Offline
Re: Terrain Generator plug-in
@keet
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.
Just for clarity: I didn't mean negative elevation, but negative increment (i.e. decrement) when using such new feature "incremental mode". This would be intended to lower down points which already have a positive elevation; they would never go below zero anyway.
Greece
Joined: May 31, 2022
Post Count: 1
Status:
Offline
Re: Terrain Generator plug-in
Hello, thank you for your efforts.
Should i report here issues? I'm receiving a NPE error when clicking the "Generate 3D teraain from rooms..." (i launched SH3D from console to see them):
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at com.eteks.sweethome3d.plugin.terraingenerator.RoomsTerrainGeneratorPlugin$5.getNextValue(Unknown Source) at java.desktop/javax.swing.plaf.basic.BasicSpinnerUI.updateEnabledState(BasicSpinnerUI.java:510) at java.desktop/javax.swing.plaf.basic.BasicSpinnerUI.updateEnabledState(BasicSpinnerUI.java:494) at java.desktop/javax.swing.plaf.basic.BasicSpinnerUI$Handler.stateChanged(BasicSpinnerUI.java:1084) at java.desktop/javax.swing.JSpinner.fireStateChanged(JSpinner.java:461) at java.desktop/javax.swing.JSpinner$ModelListener.stateChanged(JSpinner.java:388) at java.desktop/javax.swing.AbstractSpinnerModel.fireStateChanged(AbstractSpinnerModel.java:120) at com.eteks.sweethome3d.swing.NullableSpinner$NullableSpinnerNumberModel.setValue(Unknown Source) at com.eteks.sweethome3d.swing.NullableSpinner$NullableSpinnerLengthModel.setLength(Unknown Source) at com.eteks.sweethome3d.plugin.terraingenerator.RoomsTerrainGeneratorPlugin.createComponents(Unknown Source) at com.eteks.sweethome3d.plugin.terraingenerator.RoomsTerrainGeneratorPlugin.generateTerrain(Unknown Source) at com.eteks.sweethome3d.plugin.terraingenerator.RoomsTerrainGeneratorPlugin.access$100(Unknown Source) at com.eteks.sweethome3d.plugin.terraingenerator.RoomsTerrainGeneratorPlugin$1.execute(Unknown Source) at com.eteks.sweethome3d.swing.HomePane$ActionAdapter.actionPerformed(Unknown Source) at com.eteks.sweethome3d.swing.ResourceAction$AbstractDecoratedAction.actionPerformed(Unknown Source) at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967) at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308) at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405) at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:369) at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1020) at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1064) at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6635) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342) at java.desktop/java.awt.Component.processEvent(Component.java:6400) at java.desktop/java.awt.Container.processEvent(Container.java:2263) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5011) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
OS: Linux, Debian SID
SH3D: v6.6.2
TerainGenerator: v1.2
java: OpenJDK version 11.0.15 - 64bit - 0.2 / 7.8 GB provided by Debian