Commit Graph

148 Commits

Author SHA1 Message Date
wmayer
9367e73e92 LGTM: [skip ci] fix: Inconsistent definition of copy constructor and assignment ('Rule of Two')
Remove user-defined copy constructor of Exception classes without assignment operator
2020-07-27 13:47:41 +02:00
Gabriel Wicke
fb0aa86b6e [part] More robust tessellation angular deflection default
OCC currently does not reliably enforce linear deflection on curved
surfaces, especially curved lofts over nurbs splines. To avoid surprises
when tight tolerances are needed, replace the static default angular
deflection of 0.5 radians (~28 degrees), with a more sensible angular
deflection derived from the provided linear deflection tolerance.

By adding the default heuristic to TopoShape, we can keep typical
tessellate() and STL export functionality users simple, and also avoid
the need to implement similar heuristics in many places. If more
explicit control over angular deflection is needed for some use cases,
then we could still choose to expose the option to override the derived
default explicitly.

The hope is that OCC's linear deflection enforcement will be more
reliable at some point, at which point this heuristic will no longer be
needed.
2020-06-23 12:17:51 +02:00
Gabriel Wicke
7fd276c384 Part: Parallelize tessellations in TopoShape
Update parameters for all BRepMesh_IncrementalMesh instances to allow
parallel meshing. This matches what is already done for view
tessellations.

Other positional parameters are filled with their defaults in
BRepMesh_IncrementalMesh, so there should be no behavior change outside
of allowing parallelism.
2020-05-28 22:05:12 +02:00
Zheng, Lei
c09988069b Part: fix crash in TopoShape::makEFace() 2020-03-01 14:53:49 +01:00
wmayer
039f35651a Part: [skip ci] the number of domains returned by TopoShape::getDomains must match with number of faces
If a face cannot be meshed then an empty domain is added
2020-02-26 00:55:07 +01:00
Zheng, Lei
a0b14f2dcd Part: add TopoShape::getSub(Topo)Shapes() 2019-12-30 17:17:14 +01:00
luz.paz
17ada69518 Part: [skip ci] fix header uniformity
This PR fixes header uniformity across all Part WB files
2019-12-22 00:59:47 +01:00
wmayer
df8e09196d set default deflection of 0.01 when exporting shape as STL 2019-11-29 13:46:30 +01:00
asapelkin
ced8100ab9 use emplace_back instead of push_back where justified 2019-11-21 14:48:09 +01:00
howetuft
f1e3b7a166 Fix -Wredundant-move warnings, 2nd try
std::move is redundant when it is used to return a local object from a function (eg return std::move(local)): indeed, returning a local object from a function implicitly moves it. Moreover using std::move this way
See https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rf-return-move-local
However, in order to avoid -Wreturn-std-move as well, a Base object is move-constructed
from Derived when required.
2019-11-18 13:44:40 +01:00
Zheng, Lei
b4b61ce6c2 Part: fix TopoShape::getElementTypes()
This also fixes Std_BoxElementSelection in Gui/CommandView.cpp, which
relies on this API through Data::ComplexGeoData::getElementTypes().
2019-10-08 10:22:00 +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
wmayer
d05ae18340 fix -Wreturn-std-move 2019-09-07 15:19:28 +02:00
wmayer
05649e3848 include missing header 2019-09-01 17:25:42 +02:00
wmayer
b594274407 add missing header and forward declaration 2019-08-17 23:14:45 +02:00
Zheng, Lei
f028ba42ff Part: changes to Part Module
* Added Part::Feature::getTopoShape/getShape() function that can obtain
  shape from any object with proper implementation of getSubObject(). It
  can even construct compound from group object with proper implementation
  of getSubObjects().

* Modified ViewProviderExt to work on any object, because it now obtain
  the shape using Part::Feature::getShape()

* Modified various Part features to obtain base/tool shapes using
  Part::getShape(), which allows them to be any type of object,
  including Link and groups.

* Modified various Part command to relax type requirement on selected
  objects.

* Add support of link and group to dimension, and add dimension refresh
  command

* Support link and group in simple command command, and add a few more
  copy command variations.

* Add special handling of 'Shape' attribute in PropertyContainerPy and
  use Part::Feature::getShape() to return shape for any object without
  Shape property. This allows many python feature work with any object
  without modification.

* GeometrySurface/CurvePy, add convenience attribute 'Rotation'

* TopoShapePy:

    * Extended support of sub shape attribute, e.g. Compound1, Solid2,
      SubShape3 ('SubShape' is used to access child shape of a compound)

    * makeWires(), new API to sort and return wires given a list of edges.

    * transformed/translated/rotated/scaled(), return a new shape with
      some transformation.

    * findPlane(), find the plane of a planar shape

    * isCoplanar(), check if two shape are coplanar
2019-08-17 15:08:35 +02:00
Zheng, Lei
f7edaabe43 Gui: add box geometry element selection command
Implement box element selection that support linked and grouped objects.
Also modified original box selection command to support the same with
the same code.
2019-08-17 15:08:33 +02:00
Abdullah Tahiri
216926233f Part: Make 3rd party libraries into PCH 2019-05-02 07:09:22 +02:00
wmayer
dc1720a7f2 continue PCH on Part module 2019-05-01 16:10:38 +02:00
joha2
a06fa02e73 MeshToSolid: progress indicator and slightly modified sewing tolerance dialog 2019-03-31 11:30:03 +02:00
wmayer
b2a5f47e44 PVS: V560 A part of conditional expression is always true 2019-02-17 13:56:48 +01:00
wmayer
cc1bb80f24 fixes 0003020: 2D offset of circle are not in the right place 2019-01-26 22:52:40 +01:00
wmayer
b5d576f465 improve whitespaces 2019-01-26 22:52:40 +01:00
wmayer
4f10d2fac9 support face colors when writing in OpenInventor format 2019-01-12 15:06:25 +01:00
wmayer
9aa6a700d8 Replace Base::Exception with appropriate subclass 2018-11-14 19:45:20 +01:00
wmayer
6bcc7e6315 fixes 0003571: Offset3D of volumes intersection is not solid 2018-09-30 22:40:32 +02:00
wmayer
c345e4e728 fixes 0003469: FreeCAD crashes on edge selection during fillet edge operation on extruded geometry 2018-09-25 22:51:33 +02:00
wmayer
6c87152d36 fixes 0003333: Wrong behaviour of fuse operation 2018-09-25 17:53:37 +02:00
wmayer
1c7a41af58 fix -Wignored-qualifiers 2018-08-19 12:38:57 +02:00
Markus Lampert
e13c09235f Changed all catch types to references for polymorphic exceptions. 2018-08-08 15:45:30 +02:00
tomate44
32db13241b add a missing check for OCC version 2018-07-29 11:50:08 +02:00
tomate44
607a6c122b add OCC defeaturing to TopoShape 2018-07-29 11:50:06 +02:00
wmayer
25456c08de fix -Wunused 2018-07-28 12:56:31 +02:00
Yorik van Havre
37388663f6 Part: Allow to disable progress bar in brep string reader 2018-07-19 11:57:07 -03:00
wmayer
9bc9ebed21 backport to occt < 6.9 2018-06-10 21:57:25 +02:00
tomate44
9eaafad8a0 add Approximation option to TopoShape section 2018-06-10 20:59:06 +02:00
wmayer
3f38fd0057 do not use deprecated class in OCCT 7.3 2018-06-01 17:02:27 +02:00
wmayer
564b2ea86c fixes #0003493: Python Shape.isClosed() returns false for any solid, including primitive Parts 2018-05-27 15:10:44 +02:00
wmayer
4d8026762c avoid division by zero when discretizing a shape 2018-01-20 00:02:08 +01:00
wmayer
bad83d3024 port to occ 7.2.1 2018-01-03 14:31:52 +01:00
wmayer
e36535f4c0 port to occ 7.2.1 2018-01-03 14:16:23 +01:00
Unknown
f5146508bb Misc. typos 2017-12-06 20:59:55 +01:00
Unknown
31a32b9931 Doxygen Typos
+ doxy whitespace formatting
+ added more misc. typos
+ grammar fixes
[skip ci]
2017-10-15 16:27:42 +02:00
wmayer
33baa4a9f2 add convenience methods to directly set/get a placement to/from a shape 2017-09-19 15:43:28 +02:00
wmayer
eb87a20f8b use constraint to limit minimum and maximum degree 2017-09-18 12:07:00 +02:00
tomate44
f335d1f10d add MaxDegree setting to Part.Loft 2017-09-18 12:07:00 +02:00
wmayer
b9c2b58bd5 don't reverse orientation after converting mesh to shape 2017-09-12 07:59:31 +02:00
wmayer
5ec3339748 Port to occ7.2:
+ use default constructor of BRepOffsetAPI_MakeOffsetShape since overloaded versions are deprecated
+ use default constructor of BRepOffsetAPI_MakeThickSolid since overloaded versions are deprecated
+ fix small bug in MeshVertex
2017-09-02 12:04:07 +02:00
wmayer
5242f47473 Port to occ7.2:
+ replace use of StlMesh classes as they have been removed
2017-09-02 00:26:04 +02:00
wmayer
0d617f97d6 Port to occ7.2:
+ Standard_Failure::Caught() is now marked as deprecated and should be replaced with standard C++ exception handling
2017-09-01 16:27:46 +02:00