Commit Graph

496 Commits

Author SHA1 Message Date
tetektoza
527f18adcd Tests: Correct testcases after scene graph reordering in Clarify Select 2025-09-05 10:42:02 +02:00
Yorik van Havre
512a22d39b Merge pull request #22251 from furgo16/dxf-new-import-ui-and-more
Redesign DXF import UI, add Part primitives and Draft object import modes
2025-07-28 17:49:25 +02:00
Ian 'z0r0' Abreu
66ada8e10a fixing unnecessary list import 2025-07-28 08:59:52 -05:00
PaddleStroke
a897057ebb Import: Fix export crash when hidden object in Part. (#14567) 2025-07-18 11:20:04 -05:00
Furgo
df52665ae5 Import: DXF, fix typo in individual shapes import mode 2025-07-14 10:18:04 +02:00
Furgo
cf548d0b8e Import: DXF, deduplicate Part primitives creation
Create helpers that can be reused when importing entities as top-level
geometry and as part of blocks
2025-07-14 10:18:04 +02:00
Furgo
d1e131863b Import: DXF, first working version of dimensions import 2025-07-14 10:18:04 +02:00
Furgo
9f9104e182 Import: DXF, make ellipses parametric 2025-07-14 10:18:04 +02:00
Furgo
a295f9dd5c Import: DXF, first working version of Draft objects import 2025-07-14 10:18:04 +02:00
Furgo
5951d759f8 Import: DXF, first working version for import as Part primitives 2025-07-14 10:18:04 +02:00
Furgo
293ebf801c Import: DXF, add dedicated import dialog 2025-07-14 10:18:04 +02:00
Furgo
37cd1a657a Import: DXF importer, refactor preferences UI 2025-07-14 10:18:04 +02:00
Furgo
ef9378bd5b Import: improve DXF C++ importer support for BLOCK and INSERT entities (#22045)
* Import: DXF importer, block and inserts overhaul

Implement support for blocks as definitions and inserts
as instances.

A BLOCK definition becomes a hidden master object in a
_BlockDefinitions group (currently a Part::Compound).
An INSERT becomes a visible App::Link that points to
that master definition.

* Import: DXF parser/importer add debug print statements

* Import: DXF importer, various improvements

- Add more code comments
- Correctly increase object count
- Improve readability of anonymous block checks

* Import: DXF (all) report anonymous blocks separately

* Import: DXF importer (App + GUI) add nested inserts support

* Import: DXF importer (GUI) fix preserving colors for inserts

* Import: DXF importer, make primitives naming more specific

* Import: DXF parser/importer remove debug print statements

* Import: DXF parser, work around DXF color index 7

* Import: DXF importer GUI, temporary debug print to show layer color data

* Import: DXF importer, fix nested inserts hierarchy

* Import: DXF importer, prefix and suffix underscores to names

To work around mangling from FreeCAD's unique name generator.

* Import: DXF importer, implement flattening blocks on import

* Revert "Import: DXF importer GUI, temporary debug print to show layer color data"

This reverts commit b6ece395c9d2b8a1e0796d6f7b0d58842a2f3686.

* Import: DXF importer, fix imported text orientation

The DXF file provides the text rotation angle in degrees.
The used rotZ function expects the angle in radians,
thus the conversion needs to be made.

Fixes: #21548

* Import: DXF importer, honour the preference to not import layouts

* Import: DXF importer, move unreferenced blocks to separate group

This provides better classification, but it has a performance hit:
we import all blocks as before, we sort them and we reparent them
to the correct group. The reparentipart with Grou.setValues()
appears to be an expensive call. Probably because internally the
FreeCAD dependency graph is modified.

* Import: DXF importer, count compound children in the report

* Import: DXF importer, cleanup defined blocks group if empty
2025-07-12 13:38:13 +02:00
Furgo
41709fa338 Import: DXF parser, correctly pass line no. and handle 2025-06-25 07:41:03 +02:00
Furgo
318f205708 Import: DXF backend/frontend, report more unsupported features info
Now for unsupported features we report on line numbers and on the entity
handle, in case that unsupported feature is a DXF entity. To avoid
flooding the output, only a maximum of 5 instances are reported with
details. The rest simply add up to the global count and are ellipsized
in the report.

Report output is now in sentence case.
2025-06-25 07:41:03 +02:00
Furgo
89d2937afd Import: DXF parser, fix macOS linker issue 2025-06-25 07:41:03 +02:00
Furgo
3f606177e3 Import: DXF parser, remove original unsupported features count and warning 2025-06-25 07:41:03 +02:00
Furgo
789ca45280 Import: DXF importer, add code comments to C++ to Python stats passing function 2025-06-25 07:41:03 +02:00
Furgo
9eaecf6803 Import: DXF parser, add entities in paperspace count 2025-06-25 07:41:03 +02:00
Furgo
d77cdf999b Import: DXF parser, add DXF block count 2025-06-25 07:41:03 +02:00
Furgo
f84ed59a43 Import: DXF backend, frontent; add time measurement 2025-06-25 07:41:03 +02:00
Furgo
ceb72924c2 Import: DXF parser, disable now redundant unsupported entities reporting 2025-06-25 07:41:03 +02:00
Furgo
e8ce264507 Import: DXF parser/imported improve unsupported features count
Classify unsupported features by type, and report on
the breakdown.
2025-06-25 07:41:03 +02:00
Furgo
ea40128ea4 Import: DXF parser/importer, improve scale reporting
Report additional information about user scaling
value, scaling info source and resulting scale,
including units.
2025-06-25 07:41:03 +02:00
Furgo
78b720fd35 Import: DXF importer, add Python bindings 2025-06-25 07:41:03 +02:00
Furgo
72ca1478e8 Import: DXF importer, populate stats reporting structure 2025-06-25 07:41:03 +02:00
Furgo
76a0d9ffe3 Import: DXF parser, add stats reporting structure 2025-06-25 07:41:03 +02:00
Furgo
e044ddab6d DXF: do not ignore the setting that controls importing paper layouts 2025-06-23 14:06:02 +02:00
Furgo
272505d22b Import: DXF, handle non-standard 8859_1 encoding (#21905)
* Import: improve DXF importer exception handling

* Import: DXF, pinpoint erroneous header section when reading

* Import: tackle 8859_1 non-standard encoding name
2025-06-16 18:02:56 +02:00
theo-vt
1a0a68ae69 PartDesign: Fix hole centered on point edge case (#21257)
* Light refactor of getTopoShape function

* Fix hole edge case

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Refactor simplifyCompound()

* Use Base::Flags<GetShapeOption>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Shorten enum name and move it from class scope to namespace scope

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
2025-05-29 22:37:54 +02:00
Chris Hennes
f5ab6295ba UI: Remove qPixmapFromMimeSource pixmap function
This function dates back to Qt3, and was removed in Qt4. Modern Qt no
longer uses this ui file entry, and in some circumstances the uic
complains about its presence.
2025-05-15 00:56:30 +02:00
bofdahof
ba2c2ca5ad Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
Ladislav Michl
9683cf1e4f Base: rename Exception's PascalCase methods to camelCase 2025-05-05 23:50:01 +02:00
Benjamin Nauck
015cf36c38 Import: use contains() instead of count() where possible 2025-05-03 22:19:51 +02:00
Kacper Donat
77e40b9747 Base: Use explicit pointer syntax for freecad_cast (#20694)
* Base: Use explicit pointer syntax for freecad_cast

This aligns our custom cast with other casts

* All: Use explicit pointer syntax for freecad_cast
2025-04-11 14:11:33 +00:00
Pieter Hijma
5ba9037885 [Doc] Fix unassociated doc strings
Before this commit, these doc strings were unassociated, which means
that the can appear at random places.  They are now associated with
their namespace an class.
2025-04-11 00:47:54 +02:00
Kacper Donat
9d97d1c895 Base: Rename Base::freecad_dynamic_cast into freecad_cast
This is to make it shorter and easier to use. QT does the same thing
with their qobject_cast.
2025-04-07 10:32:28 -05:00
Benjamin Nauck
cf156ad897 Import: Add #include <limits> where used 2025-03-31 23:51:31 +02:00
Kevin Martin
801a507328 Correct non-gui DXF C++ importer to not generate pending python exceptions (#20328)
* Add a test case for DXF import

* Test gui flag rather than look for import error to make gui decision

The new code is cleaner and faster and avoids any exception stuff

* Properly avoid trying to use Layer's View object in non-GUI

The code was trying to avoid this but had a Python None object rather than a null C++ pointer and so tried setting a property on None. This left an unhandled exception state which acted as a booby trap that caused the later failure of some unrelated code.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* De-lint, remove wong "unsupported" message
Hidden layers have been supported for a while but still generated an import note about this being unsupported.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-03-31 11:20:37 -05:00
Benjamin Nauck
c1c14a6817 Import: Use std::numeric_limits and std::numbers instead of defines 2025-03-29 13:32:38 +01:00
mosfet80
3026bd413d Remove support to oldest occ <7.5 (#20084)
* remove support to oldest occ <7.5

The  os ubuntu 22.04 not supported use occ 7.5.1.
There is a lot of code implemented to support even older versions.
The patch removes support for versions lower than occ 7.5.0

* .

* move include library

#pieterhijma  change request :

* removed deprecated functions

get/setAngle functions has been removed with OCC 7.5
2025-03-21 13:06:47 +01:00
tritao
cdab9c7837 CMake: Cleanup targets with transitive dependencies 2025-03-17 12:12:06 +00:00
Chris Hennes
9a77120e82 Merge pull request #20142 from bofdahof/ranges
Apply C++20 std::ranges (mainly to std::find)
2025-03-17 03:08:27 -05:00
bofdahof
ab74f06ef4 Import: apply std::ranges 2025-03-16 17:16:42 -05:00
Andrea
078e315d8f Remove unnecessary check (duplicated)
before including the library, it is uselessly checked if the variable __QtAll__ and __InventorAll__ have been defined. The same check is performed again once the library is included
2025-03-10 21:53:00 +01:00
Joao Matos
6dd5246fa1 Rename DocumentCreateFlags to DocumentInitFlags. 2025-03-07 20:54:16 +00:00
Joao Matos
81a5b78b36 Convert DocumentCreateFlags instances to use designated initializer list. 2025-03-07 20:42:51 +00:00
Chris Hennes
1a2070c36f Merge pull request #19636 from kadet1090/color-in-base
Base: Move App::Color to Base
2025-03-02 16:36:40 -06:00
Benjamin Bræstrup Sayoc
ee1c73cd04 Build: suppress warnings from 3rd party libraries
Warnings from 3rd parties are not relevant and are only polluting the warning output. Marking these libraries as SYSTEM suppresses warning.

https://gcc.gnu.org/onlinedocs/cpp/Invocation.html#index-I
https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html
2025-02-25 14:39:05 +00:00
Joao Matos
15076cb504 Core: Move PyCXX library to src/3rdParty. 2025-02-24 16:36:06 +00:00