diff --git a/src/Mod/Fem/Gui/CMakeLists.txt b/src/Mod/Fem/Gui/CMakeLists.txt index 73939d9c06dc..7ebbebde6e74 100755 --- a/src/Mod/Fem/Gui/CMakeLists.txt +++ b/src/Mod/Fem/Gui/CMakeLists.txt @@ -367,6 +367,7 @@ SET(FemGuiIcon_SVG SET(FemGuiSymbol_IV Resources/symbols/ConstraintContact.iv Resources/symbols/ConstraintDisplacement.iv + Resources/symbols/ConstraintElectrostaticPotential.iv Resources/symbols/ConstraintFixed.iv Resources/symbols/ConstraintForce.iv Resources/symbols/ConstraintHeatFlux.iv diff --git a/src/Mod/Fem/Gui/Resources/symbols/ConstraintElectrostaticPotential.iv b/src/Mod/Fem/Gui/Resources/symbols/ConstraintElectrostaticPotential.iv new file mode 100644 index 000000000000..f3e62a227297 --- /dev/null +++ b/src/Mod/Fem/Gui/Resources/symbols/ConstraintElectrostaticPotential.iv @@ -0,0 +1,73 @@ +#Inventor V2.1 ascii + +# SPDX-License-Identifier: LGPL-2.1-or-later + +#/*************************************************************************** +# * Copyright (c) 2024 Mario Passaglia * +# * * +# * This file is part of FreeCAD. * +# * * +# * FreeCAD is free software: you can redistribute it and/or modify it * +# * under the terms of the GNU Lesser General Public License as * +# * published by the Free Software Foundation, either version 2.1 of the * +# * License, or (at your option) any later version. * +# * * +# * FreeCAD is distributed in the hope that it will be useful, but * +# * WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * +# * Lesser General Public License for more details. * +# * * +# * You should have received a copy of the GNU Lesser General Public * +# * License along with FreeCAD. If not, see * +# * . * +# * * +# ************************************************************************** + + +Separator { + + Separator { + + Translation { + translation 0 1.25 0 + + } + Cylinder { + radius 0.25 + height 2.5 + + } + Translation { + translation 0 1.3 0 + + } + Cube { + width 2 + height 0.1 + depth 0.75 + + } + Translation { + translation 0 0.4 0 + + } + BaseColor { + rgb 0.17 0.46 1.0 + + } + Cube { + width 1.5 + height 0.1 + depth 0.75 + + } + Translation { + translation 0 0.3 0 + + } + Cylinder { + radius 0.25 + height 0.5 + } + } +} diff --git a/src/Mod/Fem/femviewprovider/view_constraint_electrostaticpotential.py b/src/Mod/Fem/femviewprovider/view_constraint_electrostaticpotential.py index 75df41f82679..ab93fc69994c 100644 --- a/src/Mod/Fem/femviewprovider/view_constraint_electrostaticpotential.py +++ b/src/Mod/Fem/femviewprovider/view_constraint_electrostaticpotential.py @@ -36,7 +36,17 @@ class VPConstraintElectroStaticPotential(view_base_femconstraint.VPBaseFemConstraint): + def __init__(self, vobj): + super().__init__(vobj) + mat = vobj.ShapeAppearance[0] + mat.DiffuseColor = (1.0, 0.0, 0.2, 0.0) + vobj.ShapeAppearance = mat + def setEdit(self, vobj, mode=0): view_base_femconstraint.VPBaseFemConstraint.setEdit( self, vobj, mode, task_constraint_electrostaticpotential._TaskPanel ) + + def attach(self, vobj): + super().attach(vobj) + vobj.loadSymbol(self.resource_symbol_dir + "ConstraintElectrostaticPotential.iv")