Skip to content

Commit eac7abc

Browse files
bnbailey-pslheesupktrizzoAlexwei92ehfrehner
committed
[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. 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]>
1 parent a607abb commit eac7abc

File tree

885 files changed

+53214
-46562
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

885 files changed

+53214
-46562
lines changed

core/src/Context.cpp

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3607,7 +3607,7 @@ void Tube::appendTubeSegment( const helios::vec3 &node_position, float node_radi
36073607

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

36133613
if (i == 0) {
@@ -3628,10 +3628,18 @@ void Tube::appendTubeSegment( const helios::vec3 &node_position, float node_radi
36283628
// Calculate radial direction using parallel transport
36293629
vec3 rotation_axis = cross(previous_axial_vector, axial_vector);
36303630
if (rotation_axis.magnitude() > 1e-6) {
3631-
float angle = acos(previous_axial_vector * axial_vector);
3632-
previous_radial_dir = rotatePointAboutLine(previous_radial_dir, vec3(0.0f, 0.0f, 0.0f), rotation_axis, angle);
3631+
float angle = acos(std::clamp(previous_axial_vector * axial_vector, -1.0f, 1.0f));
3632+
previous_radial_dir = rotatePointAboutLine(previous_radial_dir, nullorigin, rotation_axis, angle);
3633+
} else {
3634+
// Handle the case of nearly parallel vectors
3635+
// Ensure previous_radial_dir remains orthogonal to axial_vector
3636+
previous_radial_dir = cross(axial_vector, previous_radial_dir);
3637+
if (previous_radial_dir.magnitude() < 1e-6) {
3638+
// If still degenerate, choose another orthogonal direction
3639+
previous_radial_dir = cross(axial_vector, vec3(1.0f, 0.0f, 0.0f));
3640+
}
3641+
previous_radial_dir.normalize();
36333642
}
3634-
previous_radial_dir.normalize();
36353643
}
36363644

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

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

37253733
if (i == 0) {
@@ -3740,10 +3748,18 @@ void Tube::appendTubeSegment(const helios::vec3 &node_position, float node_radiu
37403748
// Calculate radial direction using parallel transport
37413749
vec3 rotation_axis = cross(previous_axial_vector, axial_vector);
37423750
if (rotation_axis.magnitude() > 1e-6) {
3743-
float angle = acos(previous_axial_vector * axial_vector);
3744-
previous_radial_dir = rotatePointAboutLine(previous_radial_dir, vec3(0.0f, 0.0f, 0.0f), rotation_axis, angle);
3751+
float angle = acos(std::clamp(previous_axial_vector * axial_vector, -1.0f, 1.0f));
3752+
previous_radial_dir = rotatePointAboutLine(previous_radial_dir, nullorigin, rotation_axis, angle);
3753+
} else {
3754+
// Handle the case of nearly parallel vectors
3755+
// Ensure previous_radial_dir remains orthogonal to axial_vector
3756+
previous_radial_dir = cross(axial_vector, previous_radial_dir);
3757+
if (previous_radial_dir.magnitude() < 1e-6) {
3758+
// If still degenerate, choose another orthogonal direction
3759+
previous_radial_dir = cross(axial_vector, vec3(1.0f, 0.0f, 0.0f));
3760+
}
3761+
previous_radial_dir.normalize();
37453762
}
3746-
previous_radial_dir.normalize();
37473763
}
37483764

37493765
previous_axial_vector = axial_vector;
@@ -4773,10 +4789,18 @@ uint Context::addTubeObject(uint radial_subdivisions, const std::vector<vec3> &n
47734789
// Calculate radial direction using parallel transport
47744790
vec3 rotation_axis = cross(previous_axial_vector, axial_vector);
47754791
if (rotation_axis.magnitude() > 1e-6) {
4776-
float angle = acos(previous_axial_vector * axial_vector);
4777-
previous_radial_dir = rotatePointAboutLine(previous_radial_dir, vec3(0.0f, 0.0f, 0.0f), rotation_axis, angle);
4792+
float angle = acos(std::clamp(previous_axial_vector * axial_vector, -1.0f, 1.0f));
4793+
previous_radial_dir = rotatePointAboutLine(previous_radial_dir, nullorigin, rotation_axis, angle);
4794+
} else {
4795+
// Handle the case of nearly parallel vectors
4796+
// Ensure previous_radial_dir remains orthogonal to axial_vector
4797+
previous_radial_dir = cross(axial_vector, previous_radial_dir);
4798+
if (previous_radial_dir.magnitude() < 1e-6) {
4799+
// If still degenerate, choose another orthogonal direction
4800+
previous_radial_dir = cross(axial_vector, vec3(1.0f, 0.0f, 0.0f));
4801+
}
4802+
previous_radial_dir.normalize();
47784803
}
4779-
previous_radial_dir.normalize();
47804804
}
47814805

47824806
previous_axial_vector = axial_vector;
@@ -4895,10 +4919,18 @@ uint Context::addTubeObject(uint radial_subdivisions, const std::vector<vec3> &n
48954919
// Calculate radial direction using parallel transport
48964920
vec3 rotation_axis = cross(previous_axial_vector, axial_vector);
48974921
if (rotation_axis.magnitude() > 1e-6) {
4898-
float angle = acos(previous_axial_vector * axial_vector);
4899-
previous_radial_dir = rotatePointAboutLine(previous_radial_dir, vec3(0.0f, 0.0f, 0.0f), rotation_axis, angle);
4922+
float angle = acos(std::clamp(previous_axial_vector * axial_vector, -1.0f, 1.0f));
4923+
previous_radial_dir = rotatePointAboutLine(previous_radial_dir, nullorigin, rotation_axis, angle);
4924+
} else {
4925+
// Handle the case of nearly parallel vectors
4926+
// Ensure previous_radial_dir remains orthogonal to axial_vector
4927+
previous_radial_dir = cross(axial_vector, previous_radial_dir);
4928+
if (previous_radial_dir.magnitude() < 1e-6) {
4929+
// If still degenerate, choose another orthogonal direction
4930+
previous_radial_dir = cross(axial_vector, vec3(1.0f, 0.0f, 0.0f));
4931+
}
4932+
previous_radial_dir.normalize();
49004933
}
4901-
previous_radial_dir.normalize();
49024934
}
49034935

49044936
previous_axial_vector = axial_vector;

doc/CHANGELOG

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1934,4 +1934,36 @@ The radiation model has been re-designed, with the following primary additions:
19341934
- UTC offset variable changed from int to float type.
19351935

19361936
*Visualizer*
1937-
- Visualizer::printWindow() now creates the output directory if it does not already exist.
1937+
- Visualizer::printWindow() now creates the output directory if it does not already exist.
1938+
1939+
[1.3.23] 2024-11-19
1940+
1941+
*Context*
1942+
- Still some lingering issues with Context::addTubeObject() in which tube creation could fail.
1943+
1944+
*Visualizer*
1945+
- Added warning in Visualizer::buildContextGeometry() if there is existing Context geometry already in the Visualizer that may have needed to be cleared.
1946+
- When calling Visualizer::clearGeometry(), the colorbar range was not being reset, which could cause unexpected behavior.
1947+
- Changed default lighting intensity to be brighter in order to better match the default behavior of 3rd party renderers such as Blender.
1948+
- Added method Visualizer::setLightIntensityFactor() to allow users to adjust the intensity of the lighting in the scene.
1949+
1950+
*Plant Architecture*
1951+
- Some updates to bean, cowpea, and apple model parameters and assets.
1952+
- Changed PlantArchitecture::buildPlantCanopyFromLibrary() to accept an optional argument specifying the germination rate.
1953+
- Fixed error in which fruit could potentially become disconnected from their peducle over time.
1954+
- Fixed error that was causing flowers not to open.
1955+
- Added optional phenological parameter 'max_leaf_lifespan' to allow leaves to die based on age, which is especially important for evergreen plants.
1956+
- Updates to carbohydrate model. Credit to Ethan Frehner
1957+
1958+
*Photosynthesis*
1959+
- Error corrected that could cause an incorrect temperature response depending on how model parameters are set. Thanks to Kyle Rizzo for this fix.
1960+
- Added methods to disable output messages.
1961+
1962+
*Stomatal Conductance*
1963+
- Added methods to disable output messages.
1964+
1965+
*Canopy Generator*
1966+
- Error fixed when parsing XML files for strawberry canopies. Thanks to Heesup Yun for the fix.
1967+
1968+
*Radiation*
1969+
- Error corrected in the camera model related to the field of view and aspect ratio. Thanks to Peng Wei for this fix.

doc/UserGuide.dox

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! \mainpage Helios Documentation v1.3.22
1+
/*! \mainpage Helios Documentation v1.3.23
22

33
<p> <br> </p>
44

doc/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<tr id="projectrow">
4141
<td id="projectlogo"><img alt="Logo" src="Helios_logo_small.png"/></td>
4242
<td id="projectalign">
43-
<div id="projectname"><span id="projectnumber">&#160;v1.3.22</span>
43+
<div id="projectname"><span id="projectnumber">&#160;v1.3.23</span>
4444
</div>
4545
</td>
4646
</tr>

0 commit comments

Comments
 (0)