Skip to content

Commit

Permalink
Initialize output array C even when multiColoredSurface=false
Browse files Browse the repository at this point in the history
  • Loading branch information
tobolar committed Nov 7, 2023
1 parent e2661cc commit 0716d37
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ partial function partialSurfaceCharacteristic "Interface for a function returnin
<p>This partial function defines the interface of a function that returns
surface characteristics for an object visualization, see e.g.
<a href=\"modelica://Modelica.Mechanics.MultiBody.Visualizers.Advanced.SurfaceCharacteristics.torus\">Visualizers.Advanced.SurfaceCharacteristics.torus</a>.
Function which extends from this partial class shall define all outputs
<code>X</code>, <code>Y</code>, <code>Z</code> and <code>C</code>.
The last one output <code>C</code> can be set as follows when a multi-colored surface
is not utilized.
</p>
<blockquote><pre>
<strong>function</strong> mySurface
<strong>extends</strong> partialSurfaceCharacteristic(
<strong>final</strong> multiColoredSurface=false,
C=zeros(0,0,3));
...
<strong>end</strong> mySurface;
</pre></blockquote>
</html>"));
end partialSurfaceCharacteristic;
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
within Modelica.Mechanics.MultiBody.Visualizers.Advanced.SurfaceCharacteristics;
function rectangle "Function defining the surface characteristic of a planar rectangle"
extends Modelica.Mechanics.MultiBody.Interfaces.partialSurfaceCharacteristic(
final multiColoredSurface=false);
final multiColoredSurface=false,
C=zeros(0,0,3));
input SI.Distance lu=1 "Length in direction u" annotation(Dialog);
input SI.Distance lv=3 "Length in direction v" annotation(Dialog);
algorithm
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
within Modelica.Mechanics.MultiBody.Visualizers.Advanced.SurfaceCharacteristics;
function torus "Function defining the surface characteristic of a torus"
extends Modelica.Mechanics.MultiBody.Interfaces.partialSurfaceCharacteristic(
final multiColoredSurface=false);
final multiColoredSurface=false,
C=zeros(0,0,3));
input SI.Length R=1 "Major radius (distance from center of torus to center of tube)" annotation(Dialog);
input SI.Length r=0.2 "Minor radius (radius of tube)" annotation(Dialog);
input SI.Angle opening=0 "Opening angle of torus" annotation(Dialog);
Expand Down

0 comments on commit 0716d37

Please sign in to comment.