This script is designed to generate a forest of trees in an NVIDIA Isaac Sim simulation based on information provided in a .txt
file. Each line in the .txt
file represents the coordinates, type, and scale of a tree to be placed in the simulation.
Installation: Make sure you have NVIDIA Isaac Sim installed and set up.
Download Tree Models: Download tree models in USD format and specify their paths in the script. I sadly cannot share the trees I used when developing this. So you will have to find or model them yourself.
(Birch_usd_path
, Spruce_usd_path
, Pine_usd_path
, Maple_usd_path
).
Prepare Tree Coordinates File: Create a .txt
file containing tree coordinates, type, and scale information. Each line in the file should be formatted as follows:
x_coordinate; y_coordinate; z_coordinate; tree_type; scale_x; scale_y; scale_z
Run the Script: Run the script and specify the path to the tree coordinates file. Use the provided interface to generate or delete trees in the simulation.
generate_trees(path_to_coords)
This function reads tree coordinates from the specified file and generates trees in the simulation based on the provided information.
delete_forest(stage: Stage)
This function removes all trees generated by the script from the simulation.
convert_rotation(roll, pitch, yaw)
Converts rotation angles from degrees to quaternions.
check_raycast(stage, path_to_object)
Projects a raycast from the tree's origin to find the ground level and adjusts the tree's position accordingly.
The script provides a simple user interface with the following components:
Feel free to customize the script and interface according to your requirements!