Skip to content

Commit

Permalink
[1.3.23] 2024-11-19
Browse files Browse the repository at this point in the history
*Context*
- Still some lingering issues with Context::addTubeObject() in which tube creation could fail.

*Visualizer*
- Added warning in Visualizer::buildContextGeometry() if there is existing Context geometry already in the Visualizer that may have needed to be cleared.
- When calling Visualizer::clearGeometry(), the colorbar range was not being reset, which could cause unexpected behavior.
- Changed default lighting intensity to be brighter in order to better match the default behavior of 3rd party renderers such as Blender.
- Added method Visualizer::setLightIntensityFactor() to allow users to adjust the intensity of the lighting in the scene.

*Plant Architecture*
- Some updates to bean, cowpea, and apple model parameters and assets.
- Changed PlantArchitecture::buildPlantCanopyFromLibrary() to accept an optional argument specifying the germination rate.
- Fixed error in which fruit could potentially become disconnected from their peducle over time.
- Fixed error that was causing flowers not to open.
- Added optional phenological parameter 'max_leaf_lifespan' to allow leaves to die based on age, which is especially important for evergreen plants.
- Updates to carbohydrate model. Credit to Ethan Frehner

*Photosynthesis*
- Error corrected that could cause an incorrect temperature response depending on how model parameters are set. Thanks to Kyle Rizzo for this fix.
- Added methods to disable output messages.

*Stomatal Conductance*
- Added methods to disable output messages.

*Canopy Generator*
- Error fixed when parsing XML files for strawberry canopies. Thanks to Heesup Yun for the fix.

*Radiation*
- Error corrected in the camera model related to the field of view and aspect ratio. Thanks to Peng Wei for this fix.

Co-authored-by: Heesup Yun <[email protected]>
Co-authored-by: Kyle Rizzo <[email protected]>
Co-authored-by: Peng Wei <[email protected]>
Co-authored-by: Ethan Frehner <[email protected]>
  • Loading branch information
5 people committed Nov 19, 2024
1 parent a607abb commit 3f7de8a
Show file tree
Hide file tree
Showing 885 changed files with 53,211 additions and 46,559 deletions.
60 changes: 46 additions & 14 deletions core/src/Context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3607,7 +3607,7 @@ void Tube::appendTubeSegment( const helios::vec3 &node_position, float node_radi

for (int i = 0; i < node_count; i++) { // Looping over tube segments
if (radius.at(i) < 0) {
helios_runtime_error("ERROR (Context::appendTubeSegment): Radius of tube must be positive.");
helios_runtime_error("ERROR (Context::addTubeObject): Radius of tube must be positive.");
}

if (i == 0) {
Expand All @@ -3628,10 +3628,18 @@ void Tube::appendTubeSegment( const helios::vec3 &node_position, float node_radi
// Calculate radial direction using parallel transport
vec3 rotation_axis = cross(previous_axial_vector, axial_vector);
if (rotation_axis.magnitude() > 1e-6) {
float angle = acos(previous_axial_vector * axial_vector);
previous_radial_dir = rotatePointAboutLine(previous_radial_dir, vec3(0.0f, 0.0f, 0.0f), rotation_axis, angle);
float angle = acos(std::clamp(previous_axial_vector * axial_vector, -1.0f, 1.0f));
previous_radial_dir = rotatePointAboutLine(previous_radial_dir, nullorigin, rotation_axis, angle);
} else {
// Handle the case of nearly parallel vectors
// Ensure previous_radial_dir remains orthogonal to axial_vector
previous_radial_dir = cross(axial_vector, previous_radial_dir);
if (previous_radial_dir.magnitude() < 1e-6) {
// If still degenerate, choose another orthogonal direction
previous_radial_dir = cross(axial_vector, vec3(1.0f, 0.0f, 0.0f));
}
previous_radial_dir.normalize();
}
previous_radial_dir.normalize();
}

previous_axial_vector = axial_vector;
Expand Down Expand Up @@ -3719,7 +3727,7 @@ void Tube::appendTubeSegment(const helios::vec3 &node_position, float node_radiu

for (int i = 0; i < node_count; i++) { // Looping over tube segments
if (radius.at(i) < 0) {
helios_runtime_error("ERROR (Context::appendTubeSegment): Radius of tube must be positive.");
helios_runtime_error("ERROR (Context::addTubeObject): Radius of tube must be positive.");
}

if (i == 0) {
Expand All @@ -3740,10 +3748,18 @@ void Tube::appendTubeSegment(const helios::vec3 &node_position, float node_radiu
// Calculate radial direction using parallel transport
vec3 rotation_axis = cross(previous_axial_vector, axial_vector);
if (rotation_axis.magnitude() > 1e-6) {
float angle = acos(previous_axial_vector * axial_vector);
previous_radial_dir = rotatePointAboutLine(previous_radial_dir, vec3(0.0f, 0.0f, 0.0f), rotation_axis, angle);
float angle = acos(std::clamp(previous_axial_vector * axial_vector, -1.0f, 1.0f));
previous_radial_dir = rotatePointAboutLine(previous_radial_dir, nullorigin, rotation_axis, angle);
} else {
// Handle the case of nearly parallel vectors
// Ensure previous_radial_dir remains orthogonal to axial_vector
previous_radial_dir = cross(axial_vector, previous_radial_dir);
if (previous_radial_dir.magnitude() < 1e-6) {
// If still degenerate, choose another orthogonal direction
previous_radial_dir = cross(axial_vector, vec3(1.0f, 0.0f, 0.0f));
}
previous_radial_dir.normalize();
}
previous_radial_dir.normalize();
}

previous_axial_vector = axial_vector;
Expand Down Expand Up @@ -4773,10 +4789,18 @@ uint Context::addTubeObject(uint radial_subdivisions, const std::vector<vec3> &n
// Calculate radial direction using parallel transport
vec3 rotation_axis = cross(previous_axial_vector, axial_vector);
if (rotation_axis.magnitude() > 1e-6) {
float angle = acos(previous_axial_vector * axial_vector);
previous_radial_dir = rotatePointAboutLine(previous_radial_dir, vec3(0.0f, 0.0f, 0.0f), rotation_axis, angle);
float angle = acos(std::clamp(previous_axial_vector * axial_vector, -1.0f, 1.0f));
previous_radial_dir = rotatePointAboutLine(previous_radial_dir, nullorigin, rotation_axis, angle);
} else {
// Handle the case of nearly parallel vectors
// Ensure previous_radial_dir remains orthogonal to axial_vector
previous_radial_dir = cross(axial_vector, previous_radial_dir);
if (previous_radial_dir.magnitude() < 1e-6) {
// If still degenerate, choose another orthogonal direction
previous_radial_dir = cross(axial_vector, vec3(1.0f, 0.0f, 0.0f));
}
previous_radial_dir.normalize();
}
previous_radial_dir.normalize();
}

previous_axial_vector = axial_vector;
Expand Down Expand Up @@ -4895,10 +4919,18 @@ uint Context::addTubeObject(uint radial_subdivisions, const std::vector<vec3> &n
// Calculate radial direction using parallel transport
vec3 rotation_axis = cross(previous_axial_vector, axial_vector);
if (rotation_axis.magnitude() > 1e-6) {
float angle = acos(previous_axial_vector * axial_vector);
previous_radial_dir = rotatePointAboutLine(previous_radial_dir, vec3(0.0f, 0.0f, 0.0f), rotation_axis, angle);
float angle = acos(std::clamp(previous_axial_vector * axial_vector, -1.0f, 1.0f));
previous_radial_dir = rotatePointAboutLine(previous_radial_dir, nullorigin, rotation_axis, angle);
} else {
// Handle the case of nearly parallel vectors
// Ensure previous_radial_dir remains orthogonal to axial_vector
previous_radial_dir = cross(axial_vector, previous_radial_dir);
if (previous_radial_dir.magnitude() < 1e-6) {
// If still degenerate, choose another orthogonal direction
previous_radial_dir = cross(axial_vector, vec3(1.0f, 0.0f, 0.0f));
}
previous_radial_dir.normalize();
}
previous_radial_dir.normalize();
}

previous_axial_vector = axial_vector;
Expand Down
34 changes: 33 additions & 1 deletion doc/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -1934,4 +1934,36 @@ The radiation model has been re-designed, with the following primary additions:
- UTC offset variable changed from int to float type.

*Visualizer*
- Visualizer::printWindow() now creates the output directory if it does not already exist.
- Visualizer::printWindow() now creates the output directory if it does not already exist.

[1.3.23] 2024-11-19

*Context*
- Still some lingering issues with Context::addTubeObject() in which tube creation could fail.

*Visualizer*
- Added warning in Visualizer::buildContextGeometry() if there is existing Context geometry already in the Visualizer that may have needed to be cleared.
- When calling Visualizer::clearGeometry(), the colorbar range was not being reset, which could cause unexpected behavior.
- Changed default lighting intensity to be brighter in order to better match the default behavior of 3rd party renderers such as Blender.
- Added method Visualizer::setLightIntensityFactor() to allow users to adjust the intensity of the lighting in the scene.

*Plant Architecture*
- Some updates to bean, cowpea, and apple model parameters and assets.
- Changed PlantArchitecture::buildPlantCanopyFromLibrary() to accept an optional argument specifying the germination rate.
- Fixed error in which fruit could potentially become disconnected from their peducle over time.
- Fixed error that was causing flowers not to open.
- Added optional phenological parameter 'max_leaf_lifespan' to allow leaves to die based on age, which is especially important for evergreen plants.
- Updates to carbohydrate model. Credit to Ethan Frehner

*Photosynthesis*
- Error corrected that could cause an incorrect temperature response depending on how model parameters are set. Thanks to Kyle Rizzo for this fix.
- Added methods to disable output messages.

*Stomatal Conductance*
- Added methods to disable output messages.

*Canopy Generator*
- Error fixed when parsing XML files for strawberry canopies. Thanks to Heesup Yun for the fix.

*Radiation*
- Error corrected in the camera model related to the field of view and aspect ratio. Thanks to Peng Wei for this fix.
2 changes: 1 addition & 1 deletion doc/UserGuide.dox
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! \mainpage Helios Documentation v1.3.22
/*! \mainpage Helios Documentation v1.3.23

<p> <br> </p>

Expand Down
2 changes: 1 addition & 1 deletion doc/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="Helios_logo_small.png"/></td>
<td id="projectalign">
<div id="projectname"><span id="projectnumber">&#160;v1.3.22</span>
<div id="projectname"><span id="projectnumber">&#160;v1.3.23</span>
</div>
</td>
</tr>
Expand Down
Loading

0 comments on commit 3f7de8a

Please sign in to comment.