Skip to content

Commit 5d0161c

Browse files
committed
[1.3.62] 2026-01-12
- Fixed `Tube::appendTubeSegment()` to correctly add triangles for new segments using proper vertex indices instead of hardcoded values. - Refactored `readPNGAlpha()` to use RAII patterns for proper resource management and added PNG signature validation. - Fixed `cart2sphere()` singularity when converting vectors pointing straight up or down (gimbal lock), which caused camera orientation issues. - The voxel intersection plug-in has been deprecated. Use the collision detection instead. - All functionality from the voxel intersection plug-in has been incorporated in the collision detection plug-in. This also includes an OpenMP fallback if no GPU is available. - Added `electron_transport_ratio` (J/Jmax) as optional output primitive data for computing fluorescence quantum yield. - Added `listShootTypeLabels()` method with three overloads to discover available shoot types: query the currently loaded model (no parameters), query any model by name (string parameter), or query a plant instance by ID (uint parameter). - Added `resolveTextureFile()` static method for simplified asset path resolution when loading textures and OBJ models. - Updates to pistachio and walnut model parameters. - Fixed nitrogen model to track all leaves in the nitrogen map even when no nitrogen is available in the pool. - Added optional primitive data output for biochemical properties (chlorophyll, carotenoid, etc.) when using nitrogen-based automatic mode. - Fixed horizontal mirroring in camera output functions: `writePrimitiveDataLabelMap()`, `writeObjectDataLabelMap()`, `writeImageBoundingBoxes()`, `writeImageSegmentationMasks()`, `writeCameraImage()`, and related methods. - Refactored COCO annotation generation in `writeImageSegmentationMasks_ObjectData()` to ensure 1:1 correspondence between annotations and their attribute values. - Fixed `runBand()` to validate band labels from the input parameter rather than an internal variable, which caused incorrect error messages when invalid bands were passed.
1 parent 6209838 commit 5d0161c

100 files changed

Lines changed: 4548 additions & 914 deletions

File tree

Some content is hidden

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![YouTube](https://img.shields.io/badge/YouTube-FF0000?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/channel/UCUlyE4rKNGokwH5a-TioS0A)
44

5-
For complete documentation of this software, please consult <a href="https://baileylab.ucdavis.edu/software/helios">https://baileylab.ucdavis.edu/software/helios.
5+
For complete documentation of this software, please consult <a href="https://plantsimulationlab.github.io/Helios/">https://plantsimulationlab.github.io/Helios/.
66

77
Helios is a C++ library for 3D physical simulation of plant and environmental systems. It can generate and manipulate plant and other geometric objects, which can feed into biophysical model plug-ins such as radiation transfer, photosynthesis, and evapotranspiration, among others.
88

core/include/Context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* \file "Context.h" Context header file.
33
*
4-
* Copyright (C) 2016-2025 Brian Bailey
4+
* Copyright (C) 2016-2026 Brian Bailey
55
*
66
* This program is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by

core/include/global.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* \file "global.h" Header file for all global function/object definitions.
33
*
4-
* Copyright (C) 2016-2025 Brian Bailey
4+
* Copyright (C) 2016-2026 Brian Bailey
55
*
66
* This program is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by

core/include/helios_vector_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* \file "helios_vector_types.h" Declarations for vector types
33
*
4-
* Copyright (C) 2016-2025 Brian Bailey
4+
* Copyright (C) 2016-2026 Brian Bailey
55
*
66
* This program is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by

core/src/Context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* \file "Context.cpp" Context declarations.
33
*
4-
* Copyright (C) 2016-2025 Brian Bailey
4+
* Copyright (C) 2016-2026 Brian Bailey
55
*
66
* This program is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by

core/src/Context_data.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* \file "Context_data.cpp" Context primitive data, object data, and global data declarations.
33
*
4-
* Copyright (C) 2016-2025 Brian Bailey
4+
* Copyright (C) 2016-2026 Brian Bailey
55
*
66
* This program is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by

core/src/Context_fileIO.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* \file "Context_fileIO.cpp" Filesystem input/output functions within the Context.
33
*
4-
* Copyright (C) 2016-2025 Brian Bailey
4+
* Copyright (C) 2016-2026 Brian Bailey
55
*
66
* This program is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by

core/src/Context_object.cpp

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* \file "Context_object.cpp" Context compound object definitions and methods.
33
*
4-
* Copyright (C) 2016-2025 Brian Bailey
4+
* Copyright (C) 2016-2026 Brian Bailey
55
*
66
* This program is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by
@@ -2093,16 +2093,18 @@ void Tube::appendTubeSegment(const helios::vec3 &node_position, float node_radiu
20932093

20942094
// add triangles for new segment
20952095

2096+
int second_last = node_count - 2;
2097+
int last = node_count - 1;
20962098
for (int j = 0; j < radial_subdivisions; j++) {
2097-
vec3 v0 = triangle_vertices.at(1).at(j);
2098-
vec3 v1 = triangle_vertices.at(1 + 1).at(j + 1);
2099-
vec3 v2 = triangle_vertices.at(1).at(j + 1);
2099+
vec3 v0 = triangle_vertices.at(second_last).at(j);
2100+
vec3 v1 = triangle_vertices.at(last).at(j + 1);
2101+
vec3 v2 = triangle_vertices.at(second_last).at(j + 1);
21002102

21012103
UUIDs.push_back(context->addTriangle(v0, v1, v2, node_color));
21022104

2103-
v0 = triangle_vertices.at(1).at(j);
2104-
v1 = triangle_vertices.at(1 + 1).at(j);
2105-
v2 = triangle_vertices.at(1 + 1).at(j + 1);
2105+
v0 = triangle_vertices.at(second_last).at(j);
2106+
v1 = triangle_vertices.at(last).at(j);
2107+
v2 = triangle_vertices.at(last).at(j + 1);
21062108

21072109
UUIDs.push_back(context->addTriangle(v0, v1, v2, node_color));
21082110
}
@@ -2628,7 +2630,7 @@ void Cone::scaleLength(float S) {
26282630
float angle = acos_safe(dot);
26292631

26302632
// only rotate if the cone is not alread aligned with the z axis (i.e., angle is not zero. If zero, the axis of rotation is 0,0,0 and we end up with problems)
2631-
if (angle != float(0.0)) {
2633+
if (angle != 0.f) {
26322634
rotate(-1 * angle, ra);
26332635
}
26342636

@@ -2645,7 +2647,7 @@ void Cone::scaleLength(float S) {
26452647
}
26462648

26472649
// rotate back
2648-
if (angle != 0.0) {
2650+
if (angle != 0.f) {
26492651
rotate(angle, ra);
26502652
}
26512653

@@ -2672,7 +2674,7 @@ void Cone::scaleGirth(float S) {
26722674
float dot = axis_unit_vector * z_axis;
26732675
float angle = acos_safe(dot);
26742676
// only rotate if the cone is not already aligned with the z axis (i.e., angle is not zero. If zero, the axis of rotation is 0,0,0 and we end up with problems)
2675-
if (angle != float(0.0)) {
2677+
if (angle != 0.f) {
26762678
rotate(-1 * angle, ra);
26772679
}
26782680

@@ -2681,7 +2683,7 @@ void Cone::scaleGirth(float S) {
26812683

26822684

26832685
// rotate back
2684-
if (angle != 0.0) {
2686+
if (angle != 0.f) {
26852687
rotate(angle, ra);
26862688
}
26872689

core/src/Context_primitive.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* \file "Context_primitive.cpp" Context primitive type definitions and methods.
33
*
4-
* Copyright (C) 2016-2025 Brian Bailey
4+
* Copyright (C) 2016-2026 Brian Bailey
55
*
66
* This program is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by
@@ -1587,14 +1587,7 @@ float Voxel::getVolume() {
15871587
}
15881588

15891589
vec3 Voxel::getCenter() const {
1590-
vec3 center;
1591-
vec3 Y;
1592-
1593-
center.x = transform[0] * Y.x + transform[1] * Y.y + transform[2] * Y.z + transform[3];
1594-
center.y = transform[4] * Y.x + transform[5] * Y.y + transform[6] * Y.z + transform[7];
1595-
center.z = transform[8] * Y.x + transform[9] * Y.y + transform[10] * Y.z + transform[11];
1596-
1597-
return center;
1590+
return make_vec3(transform[3], transform[7], transform[11]);
15981591
}
15991592

16001593
vec3 Voxel::getSize() const {

0 commit comments

Comments
 (0)