Commit Graph

1616 Commits

Author SHA1 Message Date
tomate44
529f791c78 Part: add optional tolerance to python sortEdges() 2023-08-05 15:17:26 -06:00
wmayer
22e6e2cd40 Part/PD: modernize C++: redundant void arg 2023-08-05 16:50:31 +02:00
andrea
68101ac933 removed old OCC <7 references
removed OCC <7 references
2023-08-04 21:22:40 -06:00
Abdullah Tahiri
2834aebf90 Unused variable 2023-06-29 23:42:28 +02:00
wmayer
f09bf02b6d Part: fixes #5967: Weird behavior in Placement dialog when using "center of mass" with Datum Plane 2023-06-29 22:49:39 +02:00
Pesc0
c65f049d20 [Toponaming] create ElementMap class (#9175)
* Copypaste ElementMap
* Add MappedNameRef
* Fix missing include
* Copypaste `findTagInElementName`
* fix error introduced _somewhere_
* refactor toponaming constants
* Move `findTagInElementName` in `MappedName`
* reintroduce workaround to compile ElementMap
* Added missing functions copied from complexgeodata
* fix last compile errors, reorder and format files
* remove recursive refs to ComplexGeoData
* Add more comments
* fixed comments and added tests
* added FIXME, make functions private, misc fixes
* Move static functions from complexGeoData to PostfixStringReferences. Rename to ElementNamingUtils
* Fix broken includes due to previous change
* Revert constants from string to const char*
* added childmap tests and made hasher public
* Make functions private
* Added remaining tests
* removed bool return from `erase` functions
* fix missing appexport

Co-authored-by: John Dupuy <jdupuy98@gmail.com>
2023-06-15 09:05:24 -05:00
luzpaz
38a01939e0 Migrate domain name from freecadweb to freecad (#9352)
* Migrate domain name from freecadweb to freecad
* Migrate src/Mod/Material files
* Migrate Stylesheet related files
* Migrate *.svg files
* Migrate miscellaneous files
* Migrate some build files
* Migrate recently added TD AR_IRAM template files

Closes #6415
2023-04-24 15:19:20 -05:00
xtemp09
8f517ec5c7 Fix the typo in #9267 2023-04-15 15:41:33 +07:00
xtemp09
c03d8a058f Fix memory leak when loading a font file
- FreeCAD allocated memory to load a font file, but did not deallocate.
std::unique_ptr fixed it.
- Removed unnecessary includes
2023-04-15 01:42:19 +07:00
wmayer
17b457a783 Part: add functions to return the number of nodes and triangles of a tessellation 2023-04-11 13:34:44 +02:00
wandererfan
99644ac5e7 [Part]handle unicode filename on win 2023-03-29 15:04:57 -04:00
alexneufeld
c78bdb95b8 Explicitly use App.Vector in docstrings 2023-03-27 16:34:28 +02:00
alexneufeld
e567ff7911 fix incorrect docstring for Part.Shape.extrude method 2023-03-27 16:34:28 +02:00
wmayer
4ca33e35aa Part: make PropertyGeometryList more permissive
Since not all Geometry sub-classes fully implement Save() / Restore() raising an exception instead may invalidate a project. To avoid this
PropertyGeometryList now explicitly handles NotImplementedError exceptions.

See also: https://forum.freecad.org/viewtopic.php?t=77148
2023-03-27 16:09:33 +02:00
Andrew
1eaf8a724e Clean Mod/Part. remove old OCC <7.3 and #if 0 code. 2023-03-26 21:17:18 +02:00
Ajinkya Dahale
a4bbc79d99 [Part] Add TopoShapeOpCode.h
Constants to be used in the future.

Apply suggestions from code review

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2023-03-22 22:09:13 +05:30
wmayer
38a100962c Import/Part: [skip ci] restore some comments 2023-03-14 21:47:41 +01:00
wmayer
2a0e52e71e clang: fix -Wunused-but-set-variable 2023-03-12 15:05:21 +01:00
Andrew
91f0688625 remove unnecessary include 2023-03-10 16:35:13 +01:00
luzpaz
01e8bbc2bf Fix various typos and whitespace 2023-03-10 14:40:46 +01:00
Abdullah Tahiri
ee0c3ad5c1 Console/ILogger: Refactor and extension
=======================================

Refactor:
 - Substitute the use of variadic templates with parameter packs.
 - Use recently incorporated external library "fmt" to handle printf like formating.
 - Extensive cleaning of pragmas and unnecessary forward declarations.
 - Parameter packs and libfmt provide a much stronger type checking now, so
   conversions that are by standard implicit as bool to int need an explicit static_cast
   to avoid compilation warnings.

Extension:
 - Include a notifier field, so that the originator of the message can be provided. E.g. Document#DocumentObject
 - Include a new type of message called CriticalMessage, this message is intended to have
   special behaviour in the future. Namely, it will be used to notify forward compatilibity issues.
   It will be used to substitute the current signal/slot mechanism.
 - Include two new types of messages for user notifications (Notification and TranslatedNotification). This messages
   will be use to convey UI notifications intended for the user (such as non-intrusive message about the usage of a tool). There
   are two versions to mark whether the string provided as a message is already translated or not. When using the console system for
   notifications, these notifications may originate from the App or the Gui. In the former, it is generally the case that the strings
   of messages are not (yet) translated (but they can be marked with QT_TRANSLATE_NOOP). In the latter, often the messages to be provided
   are already translated.

Python support for CriticalMessage, Notification and TranslatedNofification, including shortcuts:

    Crt = FreeCAD.Console.PrintCritical
    Ntf = FreeCAD.Console.PrintNotification
    Tnf = FreeCAD.Console.PrintTranslatedNotification
2023-03-07 16:13:23 +01:00
luzpaz
5e9539cd9c Fix typos [skip ci] 2023-03-03 09:09:26 -06:00
wmayer
a7c37aacb0 Part: Compute center of gravity for compounds
* If the compound contains solids then other shape types like faces or edges are ignored
* If the compound contains no solids but faces then edges are ignored
* If the compound contains no faces but edges then vertexes are ignored
2023-03-02 19:34:18 +01:00
wmayer
c770e1b677 Mod: catch exception raised by Rotation::setValue 2023-03-01 18:43:15 +01:00
wandererfan
c6fd9a1532 [Part]use sharedptr for Restore 2023-03-01 14:24:40 +01:00
wandererfan
2f357a58c7 [Part]PropertyTopoShapeList changes from review 2023-03-01 14:24:40 +01:00
wandererfan
483238cc7f [Part]add PropertyTopoShapeList 2023-03-01 14:24:40 +01:00
wmayer
454c580457 Part: creating a NURBS of a circle or ellipse doesn't respect any transformation
Example:

mat = App.Matrix()
mat.rotateX(1)
mat.rotateY(1)
mat.rotateZ(1)

circle = Part.Circle()
circle.Radius = 5
circle.transform(mat)

circle.transform(mat)
Part.show(circle.toShape())

nurbs = circle.toNurbs()
Part.show(nurbs.toShape())

arc = circle.trim(0, 2)
nurbs = arc.toNurbs()
Part.show(nurbs.toShape())

spline = circle.toBSpline()
Part.show(spline.toShape())

#-------------------------

ellipse = Part.Ellipse()
ellipse.MajorRadius = 5
ellipse.MinorRadius = 3
ellipse.transform(mat)

ellipse.transform(mat)
Part.show(ellipse.toShape())

nurbs = ellipse.toNurbs()
Part.show(nurbs.toShape())

arc = ellipse.trim(0, 2)
nurbs = arc.toNurbs()
Part.show(nurbs.toShape())

spline = ellipse.toBSpline()
Part.show(spline.toShape())
2023-02-14 22:56:42 +01:00
wmayer
d6208d9b9a Part: fixes to create a NURBS for the arc of a conic
See forum: https://forum.freecad.org/viewtopic.php?t=75846
2023-02-12 19:45:00 +01:00
Pascal de Bruijn
c767880908 Increase mesh generation output quality 2023-02-03 12:08:10 -06:00
Pascal de Bruijn
3ecff9588e Tools: tweak mesh generation
Mesh generation parameters are taken from PrusaSlicer's STEP importer,
which does a just-in-time STEP->STL conversion in memory.

Resulting meshes have better geometry, but are a little larger as a result.
2023-02-03 12:08:10 -06:00
wmayer
28df3265cc Part: put instantiation of BRepAdaptor_Surface into try/catch block as for some broken faces it may fail 2023-01-31 11:04:38 -06:00
wandererfan
80da187cd7 [Part][Draft]fix #8271 temporary files on windows 2023-01-28 07:13:05 -08:00
Ajinkya Dahale
11eb9e754f [Part] Limit periodic B-spline degree to number of poles
This leads to issues down the line in Sketcher. If there is a reason this should
be permitted within Part, then Sketcher needs to be adjusted.
2023-01-16 16:45:17 +01:00
Abdullah Tahiri
152dda172c Part/Sketcher: Geometry/Geometry facade pass by const-reference instead of by value 2023-01-09 17:13:26 +01:00
Abdullah Tahiri
f49fc46051 Part: Geometry
==============

End parameter must be strictly higher to require a wrap.

Settling discussion:
https://github.com/FreeCAD/FreeCAD/pull/6971#discussion_r917295684
2022-12-21 16:01:23 +01:00
Ajinkya Dahale
2ca96161ed [Part] Fix periodic b-spline trim
When `v == u` we want to "break" the b-spline at `u` (also OCC will raise an
exception if same parameter is provided).

The range of parameter can in general be different than 1.0, so use a general term.
2022-12-21 16:01:23 +01:00
wmayer
b358407e3b Base: refactor InventorBuilder 2022-12-13 17:48:51 +01:00
wmayer
bc33b44f3e Mod: use new API of InventorBuilder 2022-12-12 20:50:32 +01:00
Uwe
3b0f96098e [Surface] enable precompiled headers
- also remove double code
2022-12-08 03:26:59 +01:00
Uwe
b4bb7c42b3 [Sketch] App: improve PreCompiled.h handling 2022-12-08 01:33:24 +01:00
Uwe
101ac1175d [Surface] App:: remove unused includes
- also some sorting
2022-12-08 00:34:08 +01:00
Uwe
5e4296bca8 [Part] improve PreCompiled.h handling 2022-12-07 23:20:46 +01:00
Uwe
0424ddc598 [PD] improve PreCompiled.h handling 2022-12-07 21:31:16 +01:00
wmayer
d21f9791b5 Part: add method TopoShape::isPlanar() 2022-12-07 15:18:04 +01:00
Ajinkya Dahale
06b30e1ec1 [Part] Add/change some methods in GeomBSplineCurve
Add `setPeriodic` to turn a b-spline periodic.
Allow `join` to join any bounded curve not just b-spline.
2022-12-04 08:17:20 +01:00
luz paz
056d1aea87 Fix various typos and grammatical issues 2022-11-30 12:45:29 +01:00
luz paz
722372c547 Part: Fix header uniformity + superfluous whitespace 2022-11-30 12:44:31 +01:00
wmayer
0349009e39 Base: refactoring of InventorBuilder 2022-11-30 12:29:09 +01:00
wmayer
cf3225b50f Base: refactoring of InventorBuilder 2022-11-29 13:28:00 +01:00