* Fix#19422 SVG: use tag create wrong size object
Fix#19072 SVG: import <defs> keyword as object without <use>
and Fix bug that not reported, <symbol> keyword as object without <use>
and Fix bug that not reported, nested use tag not import correctly.
To do this. I make preprocessor that replace use tag to it's referenced object.
and remove symbol tag and defs tag from loaded svg.
there is a subeffect, name of imported object that related to symbol tag is changed.
* Fix incorrect import when use tag nesting context.
* fix error when use tag not exist.
* rebased aprospero PR20293.
fix several bugs.
1,x and y attribute of use tag is not processed under certain condition.
2,Doesn't finish importing when referenced ID is not exist.
3,Doesn't finish importing when use tag use href instead of xlink:href
* Refactor: Use data.get() for cleaner dictionary key handling
* Refactored code for simplicity following suggested changes.
* Add <a> tag support.( <a>tag is almost same with <g> tag at visual effect )
* Correct mistakes in the if condition handling href and xlink:href
* Modify the code to retain the original namespace definitions, as removing all namespaces may cause incorrect importing process.
* Draft: Introduce 1-axis mode for ortho array
As the title says - the 1 axis mode allows to switch between all of the
axises mode and allows to modify only 1 axis at the time that user can
select with the checkbox.
* Draft: Rename to Linear Mode and remove redundant comments
* Draft: Display only one interval for the selected axis
* Draft: Cache selected variables in user.cfg - axis mode, intervals, etc...
* Draft: Make sure the checkboxes in OrthoArray are exclusively selected
* Draft: Apply review comments
Changed a couple of things according to review:
* linear mode is now being used as default during first startup (it
wasn't before)
* applied Roy's comments about coding style, etc.
* grouped everything into separate QGroupBox which is dedicated for
Linear Mode and has it's own labels, although spinboxes are shared so
during mode switch we reparent them now
* removed Orthogonal Array's icon
* in the QGroup applied naming suggested in the review, X Intervals ->
interval, etc.
* changed to radio buttons since we want exclusivity in selection
Fixes: #7387.
See comment: https://github.com/FreeCAD/FreeCAD/issues/7387#issuecomment-2915599566
PR to change the base object of BezCurve, BSpline and Wire to `Part::FeaturePython`. This will only affect new objects. So code will have to also keep handling the old object type (`Part::Part2DObjectPython`).
The modification of BimPreflight.py needs to be verified. The steps in the old code lacked logic IMO. But I may have misunderstood.
This PR fixes a V1.1 regression.
The default for the last point should be the origin of the working plane if Global mode is off.
Forum topic:
https://forum.freecad.org/viewtopic.php?t=97452
* The new align_to_face_and_edge functions would align the Y axis to the edge. This should be the X axis.
* The align_to_point_and_axis functions did not accept a zero length upvec.
* Added a return value to the _next function for compatibilty with its counterpart the _previous function.
* BIM: Use checkbox in model tree for Activation/Deactivation of WP
* BIM: Set active object after deactivating current object if it exists
Currently we can get into a scenario where user can activate two working
planes, one after another. For example, Level, and then Level001. If
they activate both, and then deactivate Level001, working plane switches
back to Level. But, we didn't set the object as the active one, so user
didn't have clear information that they can deactivate it, only the
working plane was switching it.
So this patch sets the object as the active one, if it exists.
* BIM: Add support for deactivation active object to BIM Views Tree
As the title says - it adds the checkbox that's similarly done in Part
workbench, so user can select/deselect the item and if they had previous
active object, it will also fall back to the previous object.
Also, moved out part of the common logic from ArchBuildingPart and
BimViews to utils.
* BIM: Handle correct context on activating WP for NativeIFC/BIM
* BIM: Remove redundant logic from BIM Views upon double click
As all of the logic is being handled now in `activate` function in
BimViews, this logic is redundant
* BIM: Rename button for taskbar and BIM Views from Activate to Active
* Allow to align the working plane on selected edge + face of a same object, which aligns the plane with the face, but positions it on the edge (the WP is positioned on the edge's first vertex, the WP's X axis is aligned with the edge, and the face's center point provides the third point to define the plane)
* Added a "Recenter" in-command shortcut. This moves the WP to be centered on the current snap position (the WorkingPlane snap button is taken into account, so one can only move the WP in the same plane or not).
The 'CTRL to snap' option is not the default, it should therefore not be included in the tooltips.
Additionally:
* Some obsolete info was removed.
* Some minor improvements,
Fixes#21501.
For some fonts `Part.makeWireString()` returns characters that are much smaller than the given height. This would lead to a false positive for the 'sticky font' check (which checks the area of the "L" character).
Forum topic:
https://forum.freecad.org/viewtopic.php?t=97072
The MissingVerticalHorizontal functions from the Sketcher WB do not behave as expected. See #21396.
A check for redundant contraints is required if `makeMissingVerticalHorizontal()` is used. The argument for the function should be `True`. For consistency the same was done for makeMissingPointOnPointCoincident().
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.
As the title says - currently, if user deselects Chained Mode, they
can't exit it without using ESC key for example, as the old behavior
of ContinueMode is kept under it.
So, this patch finishes the command if user has deselected it, at
the same time finishing previous chain.
The `aux.fake_function` is used in the Draft unit tests as a substitute for functions that, in most cases, do not yet exist. But in test_modification.py it would overwrite Draft.extrude leading to issues with BIM unit tests.
See:
https://github.com/FreeCAD/FreeCAD/pull/21134#issuecomment-2869178563
As the title says - currently we just have a simple circle, so I thought
with some basic adjustments it's possible to add a cool tracker that
will possibly guide user better on what they are placing on the
viewport.
* To help novice users supply an actual font file from the OS as the default for ShapeStringFontFile.
* The Draft code blocked the use of TTC font files. `Part.makeWireString()` can however handle them (although only the first font in the file can be used).
Additonally:
In a previous PR the bottom spacer was removed from the task panel. This PR brings it back as it is required in some cases. Without it the "..." button of the file selector can become huge.
So, currently, if we use Vertical/Horizontal Dimension which is
constrained in one direction vector, upon `Continue`, the direction
vector is not being preserved.
The cause of that is that everytime we recall the command in Continue
Mode, we also call base class' `Activated` method, which in turn calls
`finish()` if we have already initialized an active Draft command. This
doesn't happen during first usage of the command, because this variable
is not yet populated, but upon second (and next) runs it is. In turn,
this causes to call `finish()`, and clean up the direction vector. So,
in essence, we are specifying the vector and cleaning it every
"Continue" run.
So, as a solution, just move the direction vector as an argument to
populate super class with it, and do that after super class' `Activated()`
call, so it won't get cleaned up in `finish()`.
Co-authored-by: Yorik van Havre <yorik@uncreated.net>
Fixes#17952.
This PR is a continuation of #20719.
It mainly involves adding `self.doc`. This new attribute is then also used in the rest of the modified classes. In some cases code was slightly reordered for consistency.
The `_finish_command_on_doc_close` function has been modifief to also handle `Gui.Snapper.ui.escape` and the code in gui_arcs.py has been updated accordingly.
Additionally:
Removed the `done` and `spacedone` variables in BimWall.py by tweaking the code.
* Draft: store 3 ShapeString parameters and remove font from prefs
With this PR 3 ShapeString parameters are stored:
* ShapeStringFontFile: this replaces the old FontFile parameter.
* ShapeStringHeight
* ShapeStringText
The ShapeStringFontFile is just the last selected font file and not exposed in the Preferences editor.
Additionally:
* Changed the label of the text input box from "String" to "Text".
* Changed the label of the point reset button to sentence case.
* Remove faulty docstring
This PR adds the Global mode option to the ShapeString task panel.
Additionally:
* Rounding of coordinates caused by reading values from the task panel is avoided.
* Improved task panel layout: Height input above String input.
* Some code reformatting.
* add precision Parameter for importSVG to preferences
* rewrite svgpath import
reorganize the existing svg interpretation code snippets by dividing the responsibilities for data provision and actual shape generation.
That bears the opportunity to optimize the resulting construction data regarding consistency and precision.
* create cuts from inner paths
organize paths in a tree structure where completely contained paths are children of their sorrounding paths
In a second step the even depth paths are cut with their respective (uneven depth) children.
* move svg path import logic into its own module
* Restructure how the import result is controlled by preferences.
* reintroduce alternative transform function
Using transformGeometry() on shapes results in degenerations like lines mutating to bsplines of 1st order. For non-orthogonal Transformations this can't be avoided. But for orthogonal transformations (the majority) we can apply those transformations without degeneration.
The necessary function including fallback to transformGeometry() is already in the code but was disabled due to a regression.
See: https://tracker.freecad.org/view.php?id=2062
Associated commits: f045df1e2509e59bd4f3cb72
I reactivate the code since the degeneration of paths seems a bigger issue to me than misformed svg files producing incorrect measurements. Degenrated paths are often the culprit for later arising 3D-calculation errors.
* avoid path degeneration by keeping scale transformations uniform
* repair style application on shapes
the style should be based on the configured svgstyle mode in the svgimport preferences.
* improve logging of face generation.
* refactor: rename _precision_step to _tolerance
naming according to example set in draft utils.
* fix: indentation
* spelling