Commit Graph

21 Commits

Author SHA1 Message Date
Rayno Jiang
a5a6ed55e2 Sketcher: Scaling of a sketch containing BSplines doesn't work (#20943)
* [FreeCAD-20111] Sketcher: Scaling of a sketch containing BSplines doesn't work
When we executing Scale cmd we don't will lose knots information from shape geometry and it cause the scaled spline build with issue knots and it lead solver gets compute issue.
1. Add string format function PythonConverter::makeArryString(const std::stringstream& ss) for processing the control pnts string, mults string and knots string.
2. Add mults and knots information for python obj to make BSplineCurvePy::buildFromPolesMultsKnots(Args...) initialized Geom_BSplineCurve correctly.

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

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

* 1. fix typo
2. Add wights info to keep spline shape after convert from python object

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

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

* 1. remove static function makeArrayString() from PythonConverter
1. Add template function makeSplineInfoArrayString() to generate string for cleaner code.
2. change python string format as review suggestion

* use fmt format

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

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

Fixes #20111

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-05-09 00:02:33 +02:00
Benjamin Nauck
6a3eb2ab49 Use is<T>() when possible 2025-01-27 16:08:18 +01:00
PaddleStroke
1f7f6ce44b Formating PythonConverter.cpp 2024-10-24 11:32:20 +02:00
PaddleStroke
4390eb4dab Sketcher: PythonConverter: use getRange to handle bad arcs. 2024-10-24 11:00:46 +02:00
PaddleStroke
e7ff71c20c Sketcher: addGeometry : Remove point construction limitation. 2024-09-02 18:22:51 +02:00
PaddleStroke
0ed0d6518c Sketcher: Make it possible to specify if the constraint is active or driving during python creation. 2024-09-02 18:22:51 +02:00
PaddleStroke
a7c2b9cc6f Sketcher: Fix copy of geo constrained to axis. Fixes #14233 2024-05-27 11:37:33 -05:00
wmayer
5eabeff94e Mod: fix several compiler warnings:
* fix -Wsometimes-uninitialized
* fix -Wunused-parameter
* fix -Wunused-variable
* fix -Winconsistent-missing-override
* fix -Wsign-compare
* fix -Wreorder-ctor
* fix -Wtautological-overlap-compare
2024-02-12 11:39:32 -06:00
PaddleStroke
30bea2dd8e Sketcher: Fix sketcher_Copy bug when a single geometry was copied, geoId was not correct in constraints. 2024-01-30 17:26:42 +01:00
Paddle
85b5a343f0 Sketcher: PythonConverter: Replace useLastGeoIdVar bool by enum class 2024-01-20 06:49:32 +01:00
Paddle
f0c491ef79 Sketcher: python converter : add possibility to add lastGeoId to the constraint process. 2024-01-19 11:13:53 +01:00
Paddle
30e2a109e6 PythonConverter: Extend for Hyperbola/Parabola/BSpline 2023-12-20 06:59:47 +01:00
pre-commit-ci[bot]
e92ed45df9 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-09-12 13:02:35 -04:00
Chris Hennes
fcedce3c42 Sketcher: Reformat to current clang-format standard 2023-09-04 07:17:28 -05:00
Abdullah Tahiri
790e28c5e9 Sketcher: PythonConverter not respecting creation order
=======================================================

The original coding grouped normal and construction geometries together regardless of the actual order.

If construction geometries where interleaved with normal geometries, all normal would be grouped into a single
list and all construction into another.

This causes a problem that indices referenced in constraints may not match.

This commit fixes this behaviour. While still creating as much geometries together as a list, as many lists as
necessary are created to keep the order of creation.
2023-05-28 14:59:31 +02:00
Abdullah Tahiri
0f14065d0a Sketcher: App - Clang-format 2023-05-20 07:55:05 +02:00
flachyjoe
e2a13763e9 Sketcher: Add circle to circle distance constraint 2023-03-19 14:05:35 +01:00
Uwe
365d968ae8 [Sketch] App P - End: remove unused headers
- also some sorting
2022-12-11 22:36:00 +01:00
Uwe
b4bb7c42b3 [Sketch] App: improve PreCompiled.h handling 2022-12-08 01:33:24 +01:00
berniev
53ba98d636 Mod: use empty 2022-08-06 19:30:13 +02:00
Abdullah Tahiri
7a2b2b4c39 PythonConverter-Sketcher: A class to convert sketcher geometries and constraints into the commands to generate them
===================================================================================================================

This class does not currently support all sketcher geometry and constraints, but it supports the most common types.
2022-06-28 18:59:06 +02:00