Commit Graph

60 Commits

Author SHA1 Message Date
David Carter
ba20441935 Material: Material appearance
Uses new material system for appearance

Each feature object now has a property called ShapeMaterial that
describes its physical properties. If it has a shape, it has a
material.

The ShapeColor attribute is replaced by a ShapeAppearance attribute.
This is a material list that describes all appearance properties, not
just diffuse color. As a list in can be used for all elements of a
shape, such as edges and faces.

A new widget is provided to allow the user to select materials in a
consistent fashion. It can also launch the material editor with its
more advanced capabilities.
2024-04-04 07:39:58 -05:00
Florian Foinant-Willig
bb3eb31d4e Surface: modernize type checking 2023-10-23 18:08:22 +02:00
wmayer
255ddb746c Surface: apply clang format 2023-09-04 07:21:32 -05:00
wmayer
9f99285d59 modernize C++: use nullptr 2023-08-05 11:23:12 -06:00
tomate44
da3088d8b9 Surface: Fix Blend Curve icon name
and remove unused BlendSurface code
2023-05-29 10:53:01 +02:00
Uwe
2ef00dc9f2 [Surface] Gui:: remove unused includes
- also some sorting
2022-12-08 01:32:38 +01:00
wmayer
e56e35cf6a Surface: [skip ci] fix minor issues found by code checkers 2022-08-24 18:47:48 +02:00
wmayer
c2b9eceec1 Surface: several improvements
* fix crash because of incomplete inheritance of BlendPoint and BlendCurve -> do not inherit from BaseClass
  as consequebce make destructor non-virtual and remove getPyObject
* pass std::vector by const reference
* remove unneeded includes
* use more suitable Python exception types
* when returning with null from Python handler then set an exception
* harmonize file guards
* several optimizations or simplifications
* use modern C++
* harmonize command name
* fix copyright note
2022-08-23 16:51:55 +02:00
Matteo-Grellier
83ee62bca4 [Surface]: Implementation of BlenCurve. 2022-08-23 16:51:16 +02:00
berniev
f4ffd15864 Mod: redundant void 2 2022-08-08 10:27:50 +02:00
Uwe
bfb18671fc [Surface] remove Python.h and Xerces 2022-03-20 22:46:47 +01:00
wmayer
8f786ea6ef Gui: Optimize includes to reduce compile time 2022-03-07 20:29:18 +01:00
bitacovir
e5135dc820 [UI] Replace SVG icons for Surface WB commands 2021-01-25 16:23:54 -03:00
luz paz
67890c94f1 Surface: Issue #0004473: Expose openCommand() to translation
Continuing the work to expose the undo/redo functionality to translation. This commit does so for the Surface Wb.  
Ticket: https://tracker.freecadweb.org/view.php?id=4473
2020-12-01 14:53:35 +01:00
luz paz
ae48d4afb2 Surface: Fix header uniformity, whitespace, and doxygen header 2020-11-19 13:41:43 +01:00
vocx-fc
36f103d74c Surface, MeshPart: update CurveOnMesh command tooltip and task panel
* Add new icon `MeshPart_CurveOnMesh`, which is the same as
the `Surface_CurveOnMesh` icon but in green color.
The surface icon is used in the Surface Workbench, while the MeshPart
version is currently not used.
* Make the tooltip of the command shorter; the longer instructions
are added in the `TaskCurveOnMesh` task panel.
2020-10-19 13:18:12 +02:00
vocx-fc
6834a41a60 Surface: update tooltip of Filling 2020-10-19 13:18:12 +02:00
vocx-fc
c0d1e90920 Surface, MeshPart: add more information to the CurveOnMesh command
In the Surface Workbench, the command is called `Surface_CurveOnMesh`
and the only thing it does is call the corresponding command
in the MeshPart Workbench, where it is defined
under the name `MeshPart_CurveOnMesh`.

Currently the MeshPart Workbench is not exposed on the graphical user
interface but it is loaded at startup, and its commands
are in fact used from the Mesh Workbench and, in this case,
the Surface Workbench.

Also improve the tooltip of the other commands in the Surface Workbench:
`Cut`, `Filling`, `GeomFillSurface`, `ExtendFace`, and `Sections`.
The `Cut` command does not do anything at this moment
so it is not visible in the interface.
2020-10-13 15:14:12 +02:00
vocx-fc
e99b46de88 Surface: new icon for existing Surface_CurveOnMesh command
Add this command to the Surface toolbar.
2020-10-13 15:09:12 +02:00
vocx-fc
3ec05cefcb Surface: new Extend icon for existing Surface_ExtendFace command
The icon is added to the `.qrc` resource file.

The command is added to the Surface toolbar.
2020-10-13 14:42:20 +02:00
vocx-fc
1d486dc669 Surface: new SVG icon for the workbench, rename others
Replace the hard-coded XPM icon in `InitGui.py` for the workbench
with an SVG file, which at this time is identical to the `Surface` icon.
Change `CMakeLists.txt` to properly install this new icon.

Rename all icons, so that all have the `Surface_` prefix.

Use the new icon names in the viewproviders and task panels.
2020-09-30 12:32:36 +02:00
wmayer
db645a6ea8 Surface: [skip ci] add icon for sections command 2020-09-28 07:57:00 +02:00
wmayer
ed7cdd4c2c Surface: add command to create surface from sections 2020-09-26 16:32:42 +02:00
wmayer
e48c52c480 force strict ISO C++ (-Wpedantic)
for Drawing, Image, Inspection, Mesh, MeshPart, Part, Path, Points, Raytracing, ReverseEngineering, Spreadsheet, Start, Surface, Web

TODO: fix several -Woverflow in area
2019-09-18 11:32:42 +02:00
triplus
92efd5fbe9 Improved icon themes support 2019-02-13 10:42:46 -02:00
wmayer
5ff6945577 fix compiler warnings with py3 and msvc 2018-04-16 18:24:53 +02:00
luz.paz
69216f3604 sWhatsThis fixes
ref: https://forum.freecadweb.org/viewtopic.php?f=10&t=26687
2018-01-31 19:07:07 +01:00
wmayer
72f08f3fc8 fix compiler warning due to unused variable 2018-01-14 16:32:44 +01:00
wmayer
a1901cb20e add feature to extend given surface 2017-12-19 13:23:39 +01:00
wmayer
389f014091 Initial task panel for filling function 2017-04-22 11:12:13 +02:00
wmayer
79c762f535 rename task panel class to be conform with the feature class 2017-04-21 19:30:03 +02:00
wmayer
6f4131bece project polyline on mesh and create edge 2017-04-19 23:30:15 +02:00
wmayer
ceb519b737 fix unused variable warnings 2017-04-17 16:20:44 +02:00
wmayer
39d3fc2b69 rename SurfaceFeature to GeomFillSurface 2017-04-17 16:20:44 +02:00
wmayer
c7130b568c move handling of Bezier and BSpline surface creation into a common class to increase flexibility 2017-04-17 16:20:44 +02:00
wmayer
e106d8fede improve usability of surface function 2017-04-17 16:20:44 +02:00
wmayer
e9225fa12a choose more comprehensive class and file names 2017-04-17 16:20:44 +02:00
wmayer
01c193f74b + fix bugs in edge checking 2017-04-17 16:20:44 +02:00
wmayer
c02c90adb2 + fix design flaw to reduce side effects 2017-04-17 16:20:44 +02:00
wmayer
3bbedb1fd2 + make surface module compile with v0.17 and occ 7 2017-04-17 16:20:44 +02:00
balazs-bamer
bb6620aa85 Fix: edges of a solid can be used as surface input
Edges of a solid can be used as surface input. The real subName is
passed instead of the constant 'Edge1'
2017-04-17 16:20:44 +02:00
balazs-bamer
dd6775e0f2 Curve validation is done in a common ancestor of App and GUI
Curve validation is done in a common ancestor class of Surface::BSurf
and SurfaceGui::CmdSurfaceBSurf
2017-04-17 16:20:44 +02:00
balazs-bamer
e47e22e395 Check for null shape before calling ShapeType
Check for null shape before calling ShapeType
2017-04-17 16:20:44 +02:00
balazs-bamer
ef27ba2c8a allow wires as surface input
Now an arbitrary mixture of edges and wires can be used as input.
However, the total count of edges together with the wire members
can only be 2, 3 or 4.

For some reason, wires do not work in Python script:
test1.BoundaryList = [(Draft.upgrade([bs1a, bs2a]), 'Wire1')]
yields an empty BoundaryList
2017-04-17 16:20:44 +02:00
balazs-bamer
4e2eede777 try to convert non-b-splines into b-splines; further parameter check
Non b-spline curves are converted into b-splines if possible.
This means circles, lines etc are allowed.

Further parameter checks prohibiting surfaces being accepted as input.
2017-04-17 16:20:44 +02:00
balazs-bamer
972e024174 PropertyEnumerator for fill type
Fill type is now of type PropertyEnumerator, allowing enumerated names
in the Data tab. However, it has 2 problems:
1. Invalid shows up
2. The user has the illusion to see the result after changing the value.
However, the result gets updated only
2017-04-17 16:20:44 +02:00
balazs-bamer
901ff4a211 Warning for surfaces with 2 edges only
If the user creates a surface from 2 edges, a warning dialog appears.
Some refactoring in Command.cpp to make it simpler.
2017-04-17 16:20:44 +02:00
balazs-bamer
f47dbb54da Cancelling the just created surface deletes it
Now if the user creates a surface, the cancel in the widget deletes it.
If an already existing one is opened for editing, cancel rejects the
user change in fill type, but the surface remains.
2017-04-17 16:20:44 +02:00
balazs-bamer
512671b1e2 Unified UI for Bezier and b-spline surfaces
I have unified the user interface for Bezier and b-spline surfaces.
Based on the selection contents the CmdSurfaceBSurf::isActive method
determines which one can be created, and marks it for the activate
method.

For any sort of inappropriate selection contents, including foreign
shapes or mixture of Bezier and b-spline curves, the tool remains
disabled.
2017-04-17 16:20:44 +02:00
blobfish
2ff65140e1 task flow
synchronize fill types on setEdit
    finishing up command
    make activate for commands similar
    don't call execute directly
    remove unneeded update calls
2017-04-17 16:20:44 +02:00