Commit Graph

2548 Commits

Author SHA1 Message Date
Abdullah Tahiri
849f8ced13 Part/Sketcher: Grid - set grid orientation
==========================================

Extend ViewProviderGridExtension so that it is aware of the absolute direction of the XY plane on which the grid is to be drawn.

Fix the calculation of the cam origin.
2023-02-25 23:13:55 +01:00
Abdullah Tahiri
b4926c769e Sketcher: Grid - Imperial
=========================

Fix grid calculation in Imperial units in Auto mode (wrong scaling).

Remove observer as unit does not need to be observed.
2023-02-25 23:13:55 +01:00
0penBrain
05a5e7b341 Sketcher/Grid: fix error in parameter function call
Sketcher/Grid: fix algorithm computing the automatic grid spacing

Sketcher/Grid: forcefully redraw grid when one of its parameter is changed

Sketcher/Grid: always authorize user to change grid spacing, even if 'auto spacing' is enabled

Sketcher/Grid: apply a default factor of 10 for 'auto spacing' if number of subdivision is 1
2023-02-25 23:13:55 +01:00
Abdullah Tahiri
f9e0c1fd57 Sketcher: Grid - correction of design decisions
===============================================

Removal of ViewProviderGridExtension properties:
-GridStyle
-GridSnap

Improvement of ViewProviderGridExtension API:
- color via App::Color

Toolbar grid command:
- Conversion of Snapping to edit parameter
- Snap gets a class enum to support future Snapping functionalities as edit parameter

Sketcher Settings:
- Removal of snap preference

Behaviour:
- ShowGrid, GridAuto, GridSize preferences do not change any existing VP. They apply to any newly created sketch.
- Do not limit grid to hardcoded values

Snap to grid:
- Code updated to use closestpoint functionality provided by the extension,

Several other fixes
2023-02-25 23:13:55 +01:00
Abdullah Tahiri
d586ea6238 Sketcher/Part: Grid - Architecture
==================================

- Move all grid specific code out of ViewProviderSketch and EditModeCoinManager.
- The code in made into a new extension in Part - ViewProviderGridExtension
- ViewProviderSketch starts deriving from this new extension
- ViewProviderSketch configures the extension according to its Grid preferences
- Grid code refactored to remove hardcoded sketcher preference parameters.
- ViewProviderGridExtension handles property name/type changes within its competence.
2023-02-25 23:13:55 +01:00
0penBrain
c24f2fc09b [BugFix] Part: fix XSkew+YSkew editing not took into account for cylinders 2023-02-24 10:06:36 +01:00
Uwe
ad1f9cd0c4 [Part] fix encoding bug
- fixes the regression by #7255 -> the degree sign cannot be decoded as Latin1
2023-02-24 04:07:21 +01:00
0penBrain
569154b73f Base: introduce 'getSafeUserUnit' that fallbacks to full precision and internal unit ...
... in case unit schema would zero a non-zero quantity

 For example, using '1 mil' with UnitsSchemaImperialDecimal schema
2023-02-23 15:22:07 +01:00
0penBrain
31ecac57af Part: better quantity values handling for primitives 2023-02-23 15:22:07 +01:00
wmayer
3545c55a35 Part: don't restrict width of group boxes in section cutting dialog 2023-02-22 21:06:12 +01:00
Syres916
668ff4baf6 [Part] Fix Geometric Primitives task panel bug
See discussion https://forum.freecad.org/viewtopic.php?t=76218
2023-02-22 14:27:58 +01:00
wmayer
61d24dedf7 Part: add integration tests 2023-02-14 22:56:42 +01:00
wmayer
3f72e247ff 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
Yorik van Havre
50fb6d6b46 merged crowdin translations 2023-02-13 15:45:26 +01:00
Yorik van Havre
d74c9f0188 updated ts files 2023-02-13 15:45:26 +01:00
Uwe
4382bd199a [Part] extend SectionCutting feature for intersecting objects
- it is a well-known and often feed-backed missing feature that SectionCuttings fails for intersecting objects.
To resolve this, the objects must be put int a BooleanFragments object.
- this PR adds this functionality as option.
- since a BooleanFragments objects has a specific color, the different colors of the objects cannot be preserved. Because of this disadvantage, the BooleanFragments option will not be the default.

- this PR also modernize all for loops
2023-02-13 00:46:37 +01:00
wmayer
91048d7900 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
Yorik van Havre
c71e551556 Merged crowdin translations 2023-02-07 15:55:31 +01:00
Yorik van Havre
f51a6f2cf9 updated ts files 2023-02-07 15:55:31 +01:00
Uwe
49a7a60311 [Part] [skip ci] update a tooltip
- since FC 0.20 we require OCC 7.4
2023-02-03 12:15:28 -06:00
Pascal de Bruijn
181c7991e2 Increase mesh generation output quality 2023-02-03 12:08:10 -06:00
Pascal de Bruijn
20933f9c07 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
84aa8155ce Part: replace slots with member function pointers 2023-02-03 00:21:38 +01:00
wmayer
049056a99a 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
Yorik van Havre
4eca103469 Merged crowdin translations 2023-01-30 10:04:15 +01:00
Yorik van Havre
31b89be95f update ts files 2023-01-30 09:55:26 +01:00
wmayer
cd2a35061d Part: add integration test for SectionCut command 2023-01-28 19:51:20 +01:00
wandererfan
c318bc08cb [Part][Draft]fix #8271 temporary files on windows 2023-01-28 07:13:05 -08:00
wmayer
db6d44b1da Part: fix crash in SectionCutting dialog
It segfauls when executing the script below:
doc = App.ActiveDocument
box = doc.addObject("Part::Box", "SectionCutBoxX")
comp = doc.addObject("Part::Compound", "SectionCutCompound")
comp.Links = box
grp = doc.addObject("App::DocumentObjectGroup", "SectionCutX")
grp.addObject(comp)
doc.recompute()
2023-01-26 09:29:01 -07:00
Uwe
64caea2073 modernize a for loop 2023-01-25 17:48:08 -07:00
Uwe
5f91493d49 [Part] SectionCutting: avoid to recompute all cuts on color change
- it is not necessary and speeds up the workflow for large assemblies
2023-01-25 17:48:08 -07:00
Uwe
1f6c1fcd0f [Part] fixes for the section cutting feature
- a typical use-case is to open a document with an existing cut and only this cut is visible. When now opening the section cutting tool, the user got the fault message that there were no visible objects to be cut.
- the transparency for the cut was not explicitly set. Therefore the default transparency for new objects was used instead of the transparency of the objects to be cut.
- workaround for a graphics issue: when cutting objects intersection each other (only then), the transparency setting might be ignored. The fix is simply to change the default color slightly (By the way, this issue is independent on the color that is set in the Part preferences as color for new objects, seems to be a graphics driver or OCC issue.)

- besides this, avoid code duplication by using a lambda function
2023-01-25 17:48:08 -07:00
Yorik van Havre
166183e788 Merged crowdin translations 2023-01-23 11:25:49 +01:00
Yorik van Havre
199ef42f62 Merged crowdin translations 2023-01-17 09:40:31 +01:00
Yorik van Havre
4641218403 Updated ts files 2023-01-17 09:24:46 +01:00
Ajinkya Dahale
acb42e4109 [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
wmayer
b57e5646f6 Part: move to new style connect() 2023-01-13 17:14:07 +01:00
Abdullah Tahiri
7fcee31c07 Part/Sketcher: Geometry/Geometry facade pass by const-reference instead of by value 2023-01-09 17:13:26 +01:00
Yorik van Havre
3a8fcb53ec Merged crowdin translations 2023-01-09 14:06:28 +01:00
Yorik van Havre
0439b4dca9 Updated ts files 2023-01-09 13:24:16 +01:00
wmayer
8715297c1b Part: move to new-style connect of DlgPrimitives dialog 2023-01-04 13:06:26 +01:00
wmayer
ed8e45ac9b Part: move to new-style connect of DlgPrimitives dialog to make it also working with Qt6 2023-01-03 17:09:49 +01:00
wmayer
589bcd16f1 Part: refactor DlgPrimitives dialog 2023-01-03 15:53:12 +01:00
Uwe
46927fa897 [Part] ViewProvider.cpp: add include needed for Qt 6
- as reported in #8053, QObject has to be included to be able to compile with Qt 6
2022-12-23 01:54:36 +01:00
Yorik van Havre
8890f229ba Regenerated ts files using lupdate6.6 2022-12-22 15:39:42 +01:00
Abdullah Tahiri
c6a1644c1c 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
b937ca35d4 [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
Yorik van Havre
b5c5d0af95 Merged crowdin translations 2022-12-20 10:01:00 +01:00
Yorik van Havre
a95b7dc4b5 Updated ts files 2022-12-20 09:31:25 +01:00
wmayer
2fa8fb45d8 Base: refactor InventorBuilder 2022-12-13 17:48:51 +01:00