Commit Graph

27 Commits

Author SHA1 Message Date
Ajinkya Dahale
57fa3e44f4 [Sketcher] [planegcs] Evaluate lower degree B-spline factors 2022-12-24 18:22:16 -06:00
Uwe
db837c7468 [sketch] Geo.cpp: fix compiler warning
- as reported here: https://forum.freecadweb.org/viewtopic.php?f=10&t=73647
2022-11-20 00:38:21 +01:00
Ajinkya Dahale
e1485388d4 [Sketcher][planegcs] Make changes as per comments on #7484
Comments by @abdullahtahiriyo.

Remove default values and smaller constructor for `CenterOfGravity` and
`WeightedLinearCombination` constraints.

Clarify comments.

Improve readability of `CenterOfGravity` and `WeightedLinearCombination`
constraints.
2022-11-16 15:35:37 +01:00
Ajinkya Dahale
ba4f2bf128 [Sketcher] Constrain B-spline knots as linear combination of poles
Also squashes:

[Sketcher] Create center of gravity constraint in planegcs

[Sketcher] typo

[Sketcher] Use accurate "weights" for knots

By weights we mean the linear combination factor B_i(x) such that
spline(x) = sum(pole_i * B_i(x)) for _non-rational_ splines.

[Sketcher] Use more appropriate weights for knots

These are relevant for knots _away_ from any ends (and possibly other high
multiplicity knots).

[Sketcher] Make COG constraint weights user-definable

[Sketcher] Make `flattenedknots` for periodic B-Splines

[Sketcher] Fix incorrect setup of `flattenedknots`

Without ensuring enough space, iterators become invalid. These iterators are
needed because for periodic B-splines we need to pad flattenedknots with offset
values within flattenedknots.

Apparently there is still some iterator issues even after the reserve. Just use
fresh vectors instead.

[Sketcher] Apply knot constraints by parameter

Hopefully this will allow directly applying constraints on knots.

[Sketcher] Disable some knot updating

[Sketcher] Use center of gravity constraint on knots

[Sketcher] Fix knot COG constraint for periodic splines

[Sketcher] Add start/end point of periodic spline to solver

This removes the trouble of transferring constraints to the underlying knot.

[Sketcher] Support knot constraints on rational B-splines

[Sketcher] Remove virtual from overridden methods in planegcs

Follow 0penbrain's comments

[Sketcher][planegcs] Use `unsigned int` in signatures

Also `size_t` at places

Suggestions by @abdullahtahiriyo
2022-11-16 15:35:37 +01:00
wmayer
51186c018e Sketcher: modernize C++11
* use nullptr
2022-03-23 19:26:15 +01:00
Abdullah Tahiri
99c530bcf1 GCS: Const correctness and override qualifier
=============================================

Make several functions operate as const.
Use the override qualifier
2020-12-27 08:24:43 +01:00
luz.paz
7008cf92de Sketcher: [skip ci] fix header uniformity
This PR fixes header uniformity across all Sketcher WB files
2019-12-22 01:00:29 +01:00
luz.paz
360e581672 Misc. typo and whitespace fixes
ref: https://forum.freecadweb.org/viewtopic.php?f=3&t=30988#p256964
along with other misc. fixes
2018-09-19 17:26:03 +02:00
Abdullah Tahiri
4bfa12d86d Sketcher: Correction of B spline normals
========================================

When writting solver implementations it has to be taken into account that the normal is not to be provided in the sense of the curvature, but to
the left when walking a curve from start to end.

https://forum.freecadweb.org/viewtopic.php?f=10&t=26312#p209486

This commit has impact on all the previous files using bspline and endpoint to endpoint tangency.

A work-around is to delete the tangency and do it again.
2018-01-20 17:21:26 +01:00
Kunda
9410e751e9 source typo fixes pt4 (only on py3 merged code) 2017-03-02 13:47:21 +01:00
wmayer
c10f6fdd07 fix a couple of compiler warnings 2017-01-20 22:54:10 +01:00
wmayer
939ac5e936 Several fixes:
+ use different iterator variable for nexted loops
+ avoid loss of data warnings
+ improve layout
2017-01-20 19:40:49 +01:00
wmayer
d065c2fe5b fix whitespaces 2017-01-20 19:22:50 +01:00
Abdullah Tahiri
bb6e480b3c Sketcher: BSpline simplified endpoint tangency/perpendicularity solver implementation
=====================================================================================

Support for tangency/perpendicularity using angle via point for BSpline with appropriate
endpoint multiplicity so that the endpoints goes thru the first and last poles (control points).

Warning: Not applicable to periodic BSplines.
Warning: Not applicable to any non-periodic BSpline with inappropriate endpoint conditions.
2017-01-15 00:42:25 +01:00
Abdullah Tahiri
f35432a734 Sketcher: BSpline FreeGCS geometry definition
=============================================

multiplicities, degree and periodic are left as non-parameters of the solver, while still allowing certain manipulations to be effected from the solver
in certain situations (for example modifying the multiplicity of start/end nodes when applying G1,G2,G3 constraints between BSplines).
2017-01-05 11:58:35 +01:00
Abdullah Tahiri
e78fbfcd10 Sketcher: Parabola fix y axis in parabola rules constraint 2016-12-24 19:23:53 +01:00
Abdullah Tahiri
bb068fa7a4 Sketcher: Parabola Arc rules solver constraint 2016-12-22 16:10:33 +01:00
Abdullah Tahiri
b60aca1eca Sketcher: Freegcs Parabola geometry definition 2016-12-17 20:12:16 +01:00
Abdullah Tahiri
2d063d7811 Sketcher: Fixing compilation warnings 2016-11-27 18:45:33 +01:00
DeepSOIC
bfb1f731fe Sketcher: solver: implement Value for all other curves
for line, circle, and ellipse.
Compiles, but untested.
2016-11-27 18:45:33 +01:00
DeepSOIC
132fd77d0f Sketcher: Hyperbola: fix major radius formula 2016-11-27 18:45:33 +01:00
Abdullah Tahiri
86e12e1e3b Conflict resolution 2016-11-27 18:45:33 +01:00
Abdullah Tahiri
cb5981fceb In Part:Geometry:
- Fixing Hyperbola classes to get CCW emulation (like Ellipse classes).

In Sketcher:
- The Sketcher representation deals with the right branch of the Hyperbola only.
- Solver model is: Center, Focus1 (focus of the right branch), minor radius (b).
- HyperbolicArcRangeToEndPoints code is the one of Ellipse <= Awaiting DeepSOIC help ;)
- ConstraintPointOnHyperbola solver constraint is now implemented and should be working.
- No InternalAligment constraints implemented yet.
2016-11-27 18:45:33 +01:00
Abdullah Tahiri
e928e418ec Sketcher: New Feature: Hyperbola/ArcOfHyperbola
===============================================

- ArcOfHyperbola creation method
- Solver representation (undefined moving)
- SketchObjectPyImp (here we still miss the Part->Partdesign conversion)
- Sketch validation for hyperbola
- Hyperbola creation method: shows the "proof of concept", but it is very buggy!!

Notes:
- Missing icons, probably missing geo normal curve implementation - rebasing -
- Fixes to adapt Hyperbola to Derivector implementation and make it compile
2016-11-27 18:45:33 +01:00
wmayer
c06b6f081f fix -Wextra in Sketcher 2016-09-22 18:34:35 +02:00
wmayer
db9a68feec + fix various warnings with VC++ 2015-09-01 12:50:10 +02:00
DeepSOIC
45fe358be8 Sketcher: solver rebranding - renamed directory
Sketcher: solver rebranding - updated references

cleanup

Sketcher: GCS: remove unused NAN and INF
2015-01-02 11:48:32 +01:00