Skip to content

Conversation

@HansOlsson
Copy link
Contributor

Set LinePattern.None for shapes with gradients.
See: modelica/ModelicaSpecification#3789

@HansOlsson
Copy link
Contributor Author

Note that some of them already had this.

Copy link
Contributor

@maltelenz maltelenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? The link does not explain why this change would be something you want.

Why wouldn't you be allowed to have a line around a shape with a gradient?

@HansOlsson
Copy link
Contributor Author

Why? The link does not explain why this change would be something you want.

Why wouldn't you be allowed to have a line around a shape with a gradient?

You are allowed to have them, but often they don't make sense - so I removed for all that didn't specify pattern and had gradient.

In many cases it doesn't matter, since there's something else drawing something on top of the border.

So to be concrete:

  • Complex have a separate line around the shape with a different color; I think that is often the correct approach in many cases - i.e., one color for border and another for gradient. However, Modelica.Mechanics.Rotational.Components.Inertia has the same color for the border, but still added separately.
  • Modelica.Electrical.Analog.Basic.RotationalEMF has a rectangle with gradient that at one point connects to a solid object, having a line around the rectangle would be weird to me, similarly for Modelica.Electrical.Batteries.BatteryStacks
  • Modelica.Mechanics.Rotational.Sources.Position I don't see a benefit with lines at the end for those rectangles (it doesn't matter along the lines); ignoring the lines we get the result below in Dymola 2026x:
Position

However, it's a draft PR as I haven't looked at all of them yet.

@maltelenz
Copy link
Contributor

I'll gladly review the effects in System Modeler when you consider it ready!

@HansOlsson
Copy link
Contributor Author

Note: Will need to make a separate PR for Modelica.StateGraph.Examples.Utilities.Tank used in Modelica.StateGraph.Examples.ControlledTanks as far as I understand the gradient is in the wrong direction.

@beutlich beutlich changed the title Automatically set LinePattern.None instead of solid lines for gradients. Automatically set LinePattern.None instead of solid lines for gradients Dec 8, 2025
@HansOlsson
Copy link
Contributor Author

HansOlsson commented Dec 9, 2025

Partial verified list of changes:

Duplicated lines, which makes it obvious that border for the gradient-shape should be skipped:

  • Complex, have duplicate line
  • Modelica.Icons.Package - same with better color
  • Modelica.Icons.InternalPackage - duplicate with same color

Others that I think are improvements without border:

  • Modelica.Electrical.Analog.Basic.RotationalEMF - gradient rectangle connected on the side to solid object
  • Modelica.Electrical.Analog.Basic.TranslationalEMF - gradient rectangle free floating border barely visible, and not useful
  • Modelica.Electrical.Analog.Sources.DCPowerSupply - gradient ellipse, assuming the gradient ends at the border with lineColor (as in Dymola) it doesn't matter
  • Modelica.Electrical.Batteries.BatteryStacks, Modelica.Electrical.Batteries.BatteryStacksWithSensors - two gradient rectangles connected together. I think the border lines distract
  • Modelica.Electrical.Batteries - the borders don't help
  • Modelica.Electrical.Machines.BasicMachines.Components.PartialAirGap I don't see the benefit of the border for the gradient rectangle
  • Modelica.Electrical.Machines.BasicMachines.Components.PartialAirGapDC - border for the gradient rectangle would be a dark line interrupting a blue circle
  • Modelica.Electrical.Machines.BasicMachines.Transformers - some of the internal border lines for gradient polygons seem distracting to me
  • Modelica.Electrical.Machines.BasicMachines - having a dark line between the gradient rectangles would be distracting to me
  • Modelica.Electrical.Machines.Utilities.Coupling - dark border lines (between gradient rectangles and between them and background) distract from the actual coupling
  • Modelica.Electrical.Machines - having a dark line between the gradient rectangles would be distracting to me
  • Modelica.Electrical.QuasiStatic.Machines.BasicMachines.Transformers - some of the internal border lines for gradient polygons seem distracting to me
  • Modelica.Electrical.QuasiStatic.Machines.BasicMachines - having a dark line between the gradient rectangles would be distracting to me
  • Modelica.Electrical.QuasiStatic.Machines - having a dark line between the gradient rectangles would be distracting to me
  • Modelica.Fluid.Examples.AST_BatchPlant.BaseClasses.TankWithTopPorts - already one with no border, having a dark line at water level (in addition to color change) would be distracting to me
  • Modelica.Fluid.Examples.DrumBoiler.BaseClasses.EquilibriumDrumBoiler having a black border seem odd when there's no hard end
  • Modelica.Fluid.Examples.HeatExchanger.BaseClasses.BasicHX having a black border seem odd when there's no hard end
  • Modelica.Fluid.Fittings.SharpEdgedOrifice having a black border seem odd when there's no hard end
  • Modelica.Fluid.Fittings.AbruptAdaptor having a black border seem odd when there's no hard end and having a dark line in the middle (between the two different sized cylinders) would make a harder break than "abrupt"
  • Modelica.Fluid.Fittings.BaseClasses.PartialTeeJunction having a black border seem odd when there's no hard end (inside the T-junction)
  • Modelica.Fluid.Machines* having a black border seem odd when there's no hard end in the pumps (for the rectangle, for the ellipses they can be removed)
  • Modelica.Fluid.Pipes* having a black border seem odd when there's no hard end in the pipes
  • Modelica.Fluid.Vessels.OpenTank - having a dark line at water level (in addition to color change) would be distracting to me
  • Modelica.Fluid.Sources.MassFlowSource* - another horizontal pipe where a dark border would be distracting
  • Modelica.Fluid.Examples.AST_BatchPlant.BaseClasses.TankWith3InletOutletArraysWithEvaporatorCondensor the water levels again
  • Modelica.Magnetic.FluxTubes.Examples.Hysteresis.Components.Transformer* same as Modelica.Electrical.QuasiStatic.Machines.BasicMachines.Transformers
  • Modelica.Magnetic.FluxTubes.Examples.Utilities.TranslatoryArmatureAndStopper having a dark border between the two cylinders would be odd
  • Modelica.Magnetic.FundamentalWave and Modelica.Magnetic.QuasiStatic.FundamentalWave same as batteries (but lying down)
  • Modelica.Media.Examples.Utilities.FixedMassFlowRate and Modelica.Media.Examples.Utilities.ShortPipe pipe with watery contents (two cylinders) having a dark border at the border would be odd
  • Modelica.StateGraph.Examples.Utilities.Tank black border for dynamic water level would seem odd
  • Modelica.Thermal.FluidHeatFlow.Components.Cylinder dark borders for the two cylinders of the piston would be odd
  • Modelica.Thermal.FluidHeatFlow.Components.OpenTank - just cleanup, I don't see how it matters for this water level as there are ellipses covering it
  • Modelica.Thermal.FluidHeatFlow.Sources.IdealPump I don't see the point of this border for polygon
  • ModelicaTest.Fluid.BaseClasses* the same issue with pipes as in other cases
  • Modelica.Mechanics - yet to review

Will skip after review - the change wasn't "wrong" but there were other issues:

  • Modelica.Fluid.Examples.AST_BatchPlant.BaseClasses.TankWith3InletOutletArraysWithEvaporatorCondensor - (differences from Modelica.Fluid.Examples.AST_BatchPlant.BaseClasses.TankWithTopPorts), I would say that gradients for the two polygons don't work well. I assume the idea is to have gradient for the pipe making it look like a cylinder, but it isn't working as the gradient isn't following the pipe
  • Modelica.Electrical.Batteries.Icons.TransientRecordsPackage - this should inherit from Modelica.Icons.Package instead; or duplicate that logic - not something slightly different

Skipping spherical for ellipses (and a few rectangles), since it is mostly redundant and tools that don't have gradient at line-color at the circle radius will benefit:

  • Modelica.Fluid.Vessels.ClosedVolume
  • Modelica.Fluid.Machines*
  • Modelica.Fluid.Sources.{FixedBoundary, Boundary_pT, Boundrary_ph}
  • Modelica.Electrical.Polyphase.Basic.SaturatingInductor - not sure: spherical gradient for rectangle, this might be odd for tools that don't go to linecolor at border for this case
  • Modelica.Electrical.Machines.Losses.Friction - gradient ellipses

Polygons that are not exactly level shouldn't use cylinder-gradient.
@HansOlsson HansOlsson mentioned this pull request Dec 10, 2025
@HansOlsson
Copy link
Contributor Author

HansOlsson commented Dec 10, 2025

For Modelica.Mechanics. I note that WSM contributed quite a few improvements - especially for Rotational:

Clear improvement:

Minor, but unambiguous improvement in my opinion:

  • Modelica.Mechanics.MultiBody.Parts.Body, Modelica.Mechanics.MultiBody.Parts.BodyShape, Modelica.Mechanics.MultiBody.Parts.BodyCylinder since Modelica.Mechanics.MultiBody.Parts.BodyBox doesn't have borders and thus we get improved consistency
  • Modelica.Mechanics.MultiBody.Visualizers.VoluminousWheel - however, the related graphics is a bit off in my opinion, will open separate PR
  • Modelica.Mechanics.Rotational.Sources* (no border for these cylinders, see above)

There's already a line covering exactly that so it doesn't matter, but to me that indicates it was the intent:

  • Modelica.Mechanics.Rotational
  • Modelica.Mechanics.Rotational.Components
  • Modelica.Mechanics.Rotational.Components.AngleToTorqueAdaptor
  • Modelica.Mechanics.Rotational.Components.Brake
  • Modelica.Mechanics.Rotational.Components.IdealPlanetary (mostly)
  • Modelica.Mechanics.Rotational.Components.Inertia
  • Modelica.Mechanics.Rotational.Components.TorqueToAngleAdaptor
  • Modelica.Mechanics.Rotational.Icons.Clutch (mostly)
  • Modelica.Mechanics.MultiBody.Examples.Systems.RobotR3.Utilities.AxisType* (mostly)
  • Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing
  • Modelica.Mechanics.MultiBody.Joints.Constraints.Revolute
  • Modelica.Mechanics.MultiBody.Joints.Cylindrical
  • Modelica.Mechanics.MultiBody.Joints.Internal.RevoluteWithLengthConstraint (mostly)
  • Modelica.Mechanics.MultiBody.Joints.Revolute (mostly)
  • Modelica.Mechanics.MultiBody.Joints
  • Modelica.Mechanics.MultiBody.Parts.Rotor1D

Doesn't matter (covered) - but added for completeness

  • Modelica.Mechanics.Rotational.Components.BearingFriction
  • Modelica.Mechanics.Rotational.Components.IdealGearR2T
  • Modelica.Mechanics.Rotational.Components.IdealRollingWheel
  • Modelica.Mechanics.Rotational.Icons.Clutch (in derived classes)
  • Modelica.Mechanics.MultiBody.Joints.Assemblies.Joint*S*
  • Modelica.Mechanics.MultiBody.Joints.Constraints.Spherical
  • Modelica.Mechanics.MultiBody.Joints.Constraints.Universal
  • Modelica.Mechanics.MultiBody.Joints.GearConstraint
  • Modelica.Mechanics.MultiBody.Joints.Revolute (the axis-flange one)
  • Modelica.Mechanics.MultiBody.Joints.Spherical
  • Modelica.Mechanics.MultiBody.Joints.SphericalSpherical
  • Modelica.Mechanics.MultiBody.Joints.Universal
  • Modelica.Mechanics.MultiBody.Parts.BevelGear1D

Could be skipped, but I think it is better:

  • Modelica.Mechanics - to me the cylinder works as well without border, since it is just shown in package browser it is difficult to see
  • Modelica.Mechanics.Rotational.Components.Disc - I don't understand the graphics either way
  • Modelica.Mechanics.Rotational.Components.IdealPlanetary the outgoing part for planet-cylinder
  • Modelica.Mechanics.MultiBody.Examples.Systems.RobotR3.Utilities.AxisType*
  • Modelica.Mechanics.MultiBody.Joints.Internal.RevoluteWithLengthConstraint (the cylinder headed for "axis"-connector)
  • Modelica.Mechanics.MultiBody.Parts - to me the cylinder works as well without border, since it is just shown in package browser it is difficult to see

The rest is more optional

Could be discussed:

  • Modelica.Mechanics.MultiBody.Visualizers.PipeWithScalarField, Modelica.Mechanics.MultiBody.Visualizers.Advanced.PipeWithScalarField it gives a circle for the pipe-exit, which seems nice - but the more you think about the less that circle makes sense - and one could even argue that the circle should be lighter not darker

It matters and it could be that we should add more (other parts have different border colors):

  • Modelica.Mechanics.Rotational.Icons.Gear
  • Modelica.Mechanics.Rotational.Icons.Gearbox

HansOlsson added a commit to HansOlsson/Modelica that referenced this pull request Dec 10, 2025
…nto the wheel is ends 1mm to the left.

Previously it looked as if it was in front of the wheel (when looking at the entire icon - in small scale it doesn't matter).
The gradient-part was not changed.

Split off from modelica#4711
@HansOlsson HansOlsson mentioned this pull request Dec 10, 2025
@HansOlsson HansOlsson marked this pull request as ready for review December 10, 2025 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

icon Issues addresses the icon graphics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants