Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jean claude features #5

Draft
wants to merge 174 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
4756f3b
reorder curves A and B and resize viewports
leonjc Jun 19, 2020
8fe025f
version with more possible plots curvature of curve, abs curvature of…
leonjc Aug 15, 2020
5fc5ebc
test modification sliding for deg 3 curves with criterion at internal…
leonjc Aug 18, 2020
fb4c157
Ajustement du format des chart.js
fguibault Sep 1, 2020
c2a3775
improved layout of user interface - added new dialog elements for the…
leonjc Sep 9, 2020
5371f83
a version with an operational new interface to manage graphs (though …
leonjc Sep 11, 2020
045f670
updated version with reinitialization of functionA graph and first ve…
leonjc Sep 18, 2020
cb4755b
version with selectable clamped points at the curve extremities
leonjc Sep 29, 2020
bca9144
Add visualization of knot locations along the curve
leonjc Oct 3, 2020
83e447e
modified version using distinctKnots method and a derived class for c…
leonjc Oct 6, 2020
ebf6c92
added the input and monitoring of curve degree elevation - corrected…
leonjc Oct 13, 2020
3b1e1ee
update incorporating the load / save / save as function to read or ge…
leonjc Oct 23, 2020
b1a91d4
preliminary version with shape space monitoring when differential eve…
leonjc Nov 18, 2020
3a13465
version taking into account all configurations of removal of two infl…
leonjc Nov 19, 2020
f9ae212
updated version with improved robustness for curvature extrema remova…
leonjc Nov 25, 2020
16d5a88
bug correction of implementation of event identification criteria
leonjc Nov 26, 2020
02dd34b
corrected bugs for identification of events at transitions. Modified …
leonjc Nov 27, 2020
2c62e2a
complete version with general navigation
leonjc Nov 30, 2020
40471c8
refactoring of graphs, update of criteria detecting the boundary of s…
leonjc Dec 2, 2020
9e51ede
add smooth interaction when curvature extrema or inflections are abou…
leonjc Dec 6, 2020
f243458
add processing of curvature extremum increase when a couple of extrem…
leonjc Dec 8, 2020
047d425
add a first version of 'sliding mechanism' at the transition of shape…
leonjc Jan 4, 2021
ca6590c
A first start to monitor the constraints at the discontinuities of kn…
leonjc Jan 13, 2021
afd9dbb
première version avec contrôle des événements aux extrémités
leonjc Feb 3, 2021
381f575
gestion de contraintes pour éviter l'apparition d'extrema à des noeud…
leonjc Feb 6, 2021
0d37046
a first version with improved behavior for cubics and events near in…
leonjc Feb 24, 2021
d9afaf5
update with modification for the optimization when two extrema appear
leonjc Feb 25, 2021
988d73c
Séparation du répertoire mathematics en plusieurs modules. Point de d…
fguibault Mar 10, 2021
92903d8
Preliminary version with precise monitoring of curvature extrema ent…
leonjc Mar 10, 2021
6827e4a
corrected location of the clamped point - display curvature extrema a…
leonjc Mar 12, 2021
fae7c6a
start refactoring with objects related to the sequence of differentia…
leonjc Mar 16, 2021
6d4a7b1
refactoring version incorporating the comparison of sequences of diff…
leonjc Mar 18, 2021
cc41451
Premier test unitaire qui fonctionne
ericdemers Mar 18, 2021
25d21f3
Merge branch 'jean_claude_features' into refactoring-FG
fguibault Mar 18, 2021
15ccfc8
Fusion des dernieres modifications de Jean-Claude
fguibault Mar 18, 2021
5f01d08
faire fonctionner les tests minimalement
fguibault Mar 18, 2021
96171d1
refactoring objects related to sequence of diff events, reorganize fi…
leonjc Mar 22, 2021
779d0ff
Merge branch 'eric_features' into jean_claude_features
fguibault Mar 25, 2021
2f39195
refactoring (cntd) with new classes of comparators and localizers for…
leonjc Mar 30, 2021
fb6435c
first modification of SequenceBSpline_R1_to_R2 to get a correct code …
leonjc Apr 7, 2021
04ed834
Eliminer des fichiers généré automatiquement
fguibault Apr 8, 2021
20f9193
restructure the /test directory with sub directories - refactor Seque…
leonjc Apr 14, 2021
ace1a50
refactoring of the comparator of sequences of events. Evolution of cl…
leonjc May 6, 2021
ff98b6d
refactoring of localizer - list of current configurations entirely pr…
leonjc May 17, 2021
acfcd99
update on refactoring LocalizerOfDifferentialEvents, refactoring of C…
leonjc May 25, 2021
02efc9e
Replace 2018-2020 with 2018-2021 on the index.html web page
ericdemers May 26, 2021
c8385e8
Add debug configuration
ericdemers May 26, 2021
67518dd
added a set of unit tests for SequenceOfDifferentialEvents and starte…
leonjc May 31, 2021
2cb66d7
more unit tests related to the localization of differential events
leonjc Jun 1, 2021
a8064b2
a nearly full version of unit tests for the localizerOfDifferentialEv…
leonjc Jun 9, 2021
804e092
finalized unit tests for the localizer of differential events
leonjc Jun 16, 2021
d487477
debug and unit tests of the comparator of sequences of differrential …
leonjc Jun 18, 2021
62747c2
current update on refactoring with the insertion of navigation and an…
leonjc Jun 28, 2021
f322bf3
small update on refactoring
leonjc Jun 28, 2021
891e432
First update to refactor the optimize method with the introduction of…
leonjc Jul 8, 2021
b482d70
small update to clean up the navigate function that was part of each …
leonjc Jul 9, 2021
e999b24
current state of design template settings and classes for refactoring…
leonjc Sep 20, 2021
3ed955a
progress on refactoring with multiple state templates
leonjc Sep 29, 2021
7730bac
update of code structure using design patterns
leonjc Oct 4, 2021
b384903
First version with design templates for navigation, event monitoring …
leonjc Oct 19, 2021
8ec6cdf
modification of curveAnalyzer to get a compiled code
leonjc Oct 20, 2021
1a08f36
A first update on the modification of the Analyzer taking into accoun…
leonjc Oct 25, 2021
a42ade5
new architecture with connections to UI. Started to set up the variou…
leonjc Dec 5, 2021
8ebc073
Added selection of curve type and finalized settings of states and st…
leonjc Dec 10, 2021
bae929c
set up curve processing for no shape space constraints, i.e., no opti…
leonjc Dec 13, 2021
f1c07a1
updates on various constructors to get a consistent initialization
leonjc Jan 10, 2022
8e42cc5
first version with refactoring for graphs. Introduction of a ChartSce…
leonjc Jan 25, 2022
a6e6dd2
update on navigationState - code structure
leonjc Jan 28, 2022
4de0a70
update gitignore on branch jean_claude_features
leonjc Jan 28, 2022
68bd21d
detached the chartSceneController from the curveSceneController. Upda…
leonjc Feb 2, 2022
f7cb14e
Updated the chartControllers class diagram and added a ChartEventList…
leonjc Feb 3, 2022
9b6b67d
updated main with chartEventListener and introduce fileEventListener …
leonjc Feb 10, 2022
8f5b93e
Added a class for the user interface dialogs. Set up the FileEventLis…
leonjc Feb 17, 2022
c685952
set up event listeners classes for the user interface and observers t…
leonjc Mar 7, 2022
73b7fdb
Temporary version (does not compile) with curve models (non periodic …
leonjc Apr 1, 2022
689b20a
A first version with open and closed curve models that compiles and s…
leonjc Apr 6, 2022
ab4f1d5
update with open and closed curves (display of curves not yet updated…
leonjc Apr 20, 2022
05d1bdd
update with open and closed curve models up to the navigation context…
leonjc May 4, 2022
02667b4
update with curveShapeSpaceNavigation abstracted to handle open and c…
leonjc May 13, 2022
025fd9e
update of shaders reorganized in accordance with their graphic type. …
leonjc May 26, 2022
13d9776
organize viiews of pointbased graphical entities. Set up an observer …
leonjc Jun 3, 2022
289b433
Set up an observer dedicated to diff events to support the graphics o…
leonjc Jun 21, 2022
9cbeaef
incorporated the state template for clamped point selection, the stra…
leonjc Sep 15, 2022
4dc5b88
A first version enabling curve category change with the new user inte…
leonjc Oct 11, 2022
43dc7cb
intermediate version that requires integrating: optimizer for open cu…
leonjc Oct 25, 2022
1c893a2
A first version with the optimizer for open curves
leonjc Nov 16, 2022
4b181e7
First version with shape monitoring within nsted simplified spaces wi…
leonjc Dec 2, 2022
6ab631f
preliminary version with geometric constraints at two knot points - s…
leonjc Dec 5, 2022
4bf3ab4
A first version with two point constraints handled using scaling process
leonjc Dec 13, 2022
25931bf
First version handling two points constraints for open curves using s…
leonjc Dec 13, 2022
5967547
eric working version
ericdemers Dec 16, 2022
3799ba5
update with modifications of imports to separate from prior version o…
leonjc Feb 3, 2023
2dd7ec8
Revert "eric working version"
ericdemers Feb 3, 2023
5767243
minor modifications compared to previous version
leonjc Feb 4, 2023
b6d1434
Merge remote-tracking branch 'refs/remotes/origin/jean_claude_feature…
leonjc Feb 8, 2023
541e2db
updated version with 2 points constraint solved with non linear const…
leonjc Feb 8, 2023
461dae6
reactivation of sliding/Nosliding optimizations modes. Addition of co…
leonjc Feb 21, 2023
7d8b83d
Cleaned up the code to clarify curveShapeSpaceNavigator, navigationCu…
leonjc Feb 28, 2023
db9c49c
First integration of BaseOpBSplineR1toR2 with OptimizationProblem_BSp…
leonjc Mar 1, 2023
531a906
Update on progress with connection of design patterns to the optimiza…
leonjc Mar 10, 2023
1cb439e
Connections of design patterns and states of UI button for the manage…
leonjc Mar 16, 2023
b829c93
First step to set up interaction associated with the monitoring of ev…
leonjc Mar 24, 2023
77dc3ff
Update integration of BSpline classes with factory method
leonjc Mar 24, 2023
3a7fa61
Set up classes, unit tests and started integration of these classes t…
leonjc Mar 31, 2023
f2ff32e
First version incorporating clsses describing polygons for A(u) and B…
leonjc Apr 7, 2023
340947b
minor editing updates
leonjc Apr 7, 2023
431c872
other minor editing updates
leonjc Apr 7, 2023
9bb51ea
First version with new sliding process
leonjc Apr 11, 2023
21adc69
Update of BaseOpSplineR1toR2 class with new signature and update of c…
leonjc Apr 29, 2023
e56308b
Update on classes for optimization problem preparation
leonjc May 5, 2023
83c02d9
First update of OptProblemBSplineR1toR2WithWeigthingFactorsGeneralNav…
leonjc May 15, 2023
5f19431
carry on integration of OptProblemBSplineR1toR2WithWeigthingFactorsGe…
leonjc May 19, 2023
947da1f
First version with optimization monitoring to handle the entrance of …
leonjc Jun 5, 2023
45439cc
Added management of curvature extrema appearing and disappearing (sim…
leonjc Jun 13, 2023
248edd6
updated version of curve management at the boundary of a shape space:…
leonjc Jul 5, 2023
b489d66
cleaned-up CurveSceneController (nearly finished). First version of n…
leonjc Jul 6, 2023
7e84bc5
first version of navigation within nested shape spaces with monitorin…
leonjc Jul 13, 2023
2616163
Updated navigation strictly inside shape spaces with new strategies o…
leonjc Jul 16, 2023
4348077
updated unit tests related to neighboring events (comparison of seque…
leonjc Sep 3, 2023
64e72f1
added new elementary event type to characterize simultaneous changes …
leonjc Sep 7, 2023
02d3732
addition of new elementary diffrential event status for events modifi…
leonjc Sep 12, 2023
11025bb
update with first modifications to track curvature extrema events dur…
leonjc Dec 3, 2023
be64220
fixed some closed curve display issues: display of control polygon an…
leonjc Mar 5, 2024
94576a2
updated prototype of controlPolygonView method
leonjc Mar 5, 2024
705fccc
updated knot insertion for closed curves. Updated observers for the t…
leonjc Mar 6, 2024
2f07ff8
An updated version of the modifications required to process knot inse…
leonjc Mar 30, 2024
6e6d423
current update about the knotsequence class
leonjc Apr 2, 2024
b88e8ce
An update of knotsequence incorporating an iterator
leonjc Apr 2, 2024
fc69cdf
A more structured version of the knot sequence classes before startin…
leonjc Apr 8, 2024
0339276
reorganisation of the classes of knot sequence into separated files, …
leonjc Apr 11, 2024
c7ebb6b
set up unit tests to validate methods for open knot sequences of open…
leonjc Apr 28, 2024
c74cbcc
code update for open knot sequences of closed curves and associated u…
leonjc May 2, 2024
4ab4667
Started integration of new knot sequence classes into BSplineR1toR1. …
leonjc May 6, 2024
e3cf6f4
An updated version with the integration of the new knot sequence obje…
leonjc May 9, 2024
d723d6f
updated version of integration of knot sequence objects into BSplineR…
leonjc May 14, 2024
09a8009
integration of knot sequence objects into AbstractBSplineR1toR1, BSpl…
leonjc May 16, 2024
1f07745
started integration of knot sequence object in abstractBSplineR1toR2 …
leonjc May 20, 2024
75dda8a
updated some classes of knotsequences, introduced knot sequence prope…
leonjc May 26, 2024
f9afce5
first level of integration of the knot sequence object into the class…
leonjc May 27, 2024
b4c53e4
updated version with integration of knot sequence objects. Knot inser…
leonjc Jun 1, 2024
2d98778
commented methods after integration of knot sequence objects integrat…
leonjc Jun 3, 2024
cb44e3b
addition of new unit tests related to degreeIncrement. Corrected knot…
leonjc Jun 9, 2024
4b6f0c4
added classes for periodic knot sequence of closed curves (partial de…
leonjc Jun 16, 2024
36924e5
updated periodic knot sequence classes. Added methods similar to open…
leonjc Jun 20, 2024
9da2a1f
started integration of PeriodicKnotSequence with through two classes …
leonjc Jun 25, 2024
20d01e5
PeriodicBSplineR1toR2 with private constructor and static function to…
leonjc Jul 5, 2024
320fc33
update of PeriodicBSplineR1toR2 with degree increment algo, updates o…
leonjc Jul 10, 2024
f7b6015
Update of basisFunctionsFromSequence, evaluate, abscissaAtIndex and a…
leonjc Jul 13, 2024
d34e538
update of basisFunctionsFromSequence, evaluate, insertKnotBoehmAlgori…
leonjc Jul 23, 2024
e6c899c
update of degreeIncrement method for periodic B-Spline. Addition of t…
leonjc Jul 27, 2024
172386a
update of extractSubsetOfAbscissae for increasing periodic knot seque…
leonjc Aug 16, 2024
cea92fb
updated extractSubsetOfAbscissae to cope with periodic curves having …
leonjc Aug 17, 2024
0667779
addition of conversions from periodic BSpline with periodic knot sequ…
leonjc Aug 21, 2024
466f6fb
updated version of the knot insertion algorithm for periodic B-Spline…
leonjc Aug 27, 2024
e0c6994
Added curve extraction method for periodic B-Splines, curve opening m…
leonjc Sep 2, 2024
7137b05
update of PeriodicBSplineR1toR2 class with methods incorporating vali…
leonjc Sep 9, 2024
43cc444
update with more unit tests for the PeriodicBSplineR1toR2 class
leonjc Sep 10, 2024
9ba8713
Changed the degree parameter in all knotsequence classes to a maxMult…
leonjc Oct 3, 2024
b162db0
First version with possibilities to use different categories of input…
leonjc Oct 6, 2024
ead51be
Cleaned up the code of the iterator of increasing open knot sequences…
leonjc Oct 7, 2024
28f8216
Update with the introduction of the different constructors for strict…
leonjc Oct 12, 2024
b40fee1
Update with code factorization after the introduction of different co…
leonjc Oct 16, 2024
37a6955
update with the introduction of different constructors for periodic k…
leonjc Oct 18, 2024
e58ef45
Update with effective distinction between increasing and strictly inc…
leonjc Oct 20, 2024
a3b2be5
Update with more unit tests for IncreasingOpenKnotOpenKnotSequence. R…
leonjc Oct 22, 2024
ecaff61
rewriting and addition of new unit tests for increasing open knot seq…
leonjc Nov 2, 2024
20068b8
Update with more unit tests for increasing open knot sequence open cu…
leonjc Nov 12, 2024
759f46c
Resolved circular dependencies of imports. Created functions to perfo…
leonjc Nov 15, 2024
a9b0697
Reorganization of named constants, warning messages, error messages, …
leonjc Nov 17, 2024
1e30c17
First complete version of unit tests for IncreasingOpenKnotSequenceOp…
leonjc Nov 19, 2024
7b5cc1e
update with modifications of IncreasingOpenKnotSequenceClosedCurve to…
leonjc Nov 26, 2024
3ce9c19
Complete version of unit tests for IncreasingOpenKnotSequenceClosedCu…
leonjc Nov 29, 2024
93270cb
partial version of unit tests for StrictlyIncreasingOpenKnotSequenceC…
leonjc Dec 10, 2024
1246b7e
complete version of unit tests for the class StrictlyIncreasingOpenKn…
leonjc Dec 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
version taking into account all configurations of removal of two infl…
…ections
leonjc committed Nov 19, 2020
commit 3a13465f454919000f7e563beac854a008d8cb22
48 changes: 41 additions & 7 deletions dist/bundle.js
Original file line number Diff line number Diff line change
@@ -39390,7 +39390,18 @@ var SlidingStrategy = /** @class */ (function () {
else if (inflectionIndices.length - inflectionIndicesOptim.length === 1) {
/* JCL One inflection has been lost -> case of inflection gone outside the curve through one extremity */
if (orderedDifferentialEvents[0].event === DiffEventType.inflection && orderedDifferentialEventsOptim.length === 0) {
result.push({ event: NeighboringEventsType.neighboringInflectionLeftBoundary, index: 0 });
var intervalExtrema = [];
intervalExtrema.push(orderedDifferentialEvents[0].loc);
if (orderedDifferentialEvents.length === 1) {
intervalExtrema.push(1.0 - orderedDifferentialEvents[0].loc);
}
else
throw new Error("Inconsistent content of the sequence of events to identify the curve extremity where the inflection is lost.");
if (intervalExtrema[0] > intervalExtrema[intervalExtrema.length - 1]) {
result.push({ event: NeighboringEventsType.neighboringInflectionRightBoundary, index: 0 });
}
else
result.push({ event: NeighboringEventsType.neighboringInflectionLeftBoundary, index: 0 });
}
else if (orderedDifferentialEvents[0].event === DiffEventType.inflection && orderedDifferentialEventsOptim[0].event !== DiffEventType.inflection) {
result.push({ event: NeighboringEventsType.neighboringInflectionLeftBoundary, index: 0 });
@@ -39399,7 +39410,7 @@ var SlidingStrategy = /** @class */ (function () {
result.push({ event: NeighboringEventsType.neighboringInflectionRightBoundary, index: orderedDifferentialEvents.length - 1 });
}
else {
throw new Error("Inconsistent content of the sequence of event to identify the loss of an inflection at a curve extremity.");
throw new Error("Inconsistent content of the sequence of events to identify the loss of an inflection at a curve extremity.");
}
}
else if (orderedDifferentialEvents.length - orderedDifferentialEventsOptim.length === 2 && inflectionIndices.length - inflectionIndicesOptim.length === 2) {
@@ -39421,7 +39432,10 @@ var SlidingStrategy = /** @class */ (function () {
refEventLocationOptim.push(i);
}
}
if (refEventLocationOptim.length !== refEventLocation.length - 1 && inflectionIndicesOptim.length !== inflectionIndices.length - 2) {
if (inflectionIndicesOptim.length !== inflectionIndices.length - 2 &&
((refEventLocationOptim.length !== refEventLocation.length - 1 && refEventLocation.length === 1) ||
(refEventLocationOptim.length !== refEventLocation.length - 2 && refEventLocation.length > 1) ||
(refEventLocationOptim.length !== refEventLocation.length - 3 && refEventLocation.length > 2))) {
throw new Error("Inconsistency of reference type event that does not coincide with oscillation removal.");
}
else {
@@ -39439,6 +39453,26 @@ var SlidingStrategy = /** @class */ (function () {
intervalEventOptim.push(refEventLocationOptim[j + 1] - refEventLocationOptim[j]);
}
}
else {
if (refEventLocation.length === 1)
result.push({ event: NeighboringEventsType.neighboringInflectionsCurvatureExtremum, index: refEventLocation[0] });
if (refEventLocation.length === 2) {
if (orderedDifferentialEventsOptim[refEventLocation[0]].event === DiffEventType.inflection)
result.push({ event: NeighboringEventsType.neighboringInflectionsCurvatureExtremum, index: refEventLocation[1] });
else
result.push({ event: NeighboringEventsType.neighboringInflectionsCurvatureExtremum, index: refEventLocation[0] });
}
if (refEventLocation.length === 3) {
if (orderedDifferentialEventsOptim[refEventLocation[0]].event === DiffEventType.inflection &&
orderedDifferentialEventsOptim[refEventLocation[1]].event === DiffEventType.inflection)
result.push({ event: NeighboringEventsType.neighboringInflectionsCurvatureExtremum, index: refEventLocation[2] });
else if (orderedDifferentialEventsOptim[refEventLocation[0]].event === DiffEventType.inflection &&
orderedDifferentialEventsOptim[refEventLocation[1]].event !== DiffEventType.inflection)
result.push({ event: NeighboringEventsType.neighboringInflectionsCurvatureExtremum, index: refEventLocation[1] });
else
result.push({ event: NeighboringEventsType.neighboringInflectionsCurvatureExtremum, index: refEventLocation[0] });
}
}
for (var k = 0; k < intervalEventOptim.length; k += 1) {
if (intervalEvent[k] !== intervalEventOptim[k]) {
result.push({ event: NeighboringEventsType.neighboringInflectionsCurvatureExtremum, index: refEventLocation[k] });
@@ -39464,7 +39498,7 @@ var SlidingStrategy = /** @class */ (function () {
var curvatureExtremaLocations = splineDP.curvatureDerivativeNumerator().zeros();
var inflectionLocations = splineDP.curvatureNumerator().zeros();
var sequenceDiffEventsInit = this.generateSequenceDifferentialEvents(curvatureExtremaLocations, inflectionLocations);
//console.log("Event(s): ", JSON.parse(JSON.stringify(sequenceDiffEventsInit)))
console.log("Event(s): ", JSON.parse(JSON.stringify(sequenceDiffEventsInit)));
/*console.log("optimize: inits0X " + this.curveModel.spline.controlPoints[0].x + " inits0Y " + this.curveModel.spline.controlPoints[0].y + " ndcX " + ndcX + " ndcY " + ndcY )*/
this.curveModel.setControlPoint(selectedControlPoint, ndcX, ndcY);
this.optimizationProblem.setTargetSpline(this.curveModel.spline);
@@ -39483,7 +39517,7 @@ var SlidingStrategy = /** @class */ (function () {
var curvatureExtremaLocationsOptim = splineDPoptim.curvatureDerivativeNumerator().zeros();
var inflectionLocationsOptim = splineDPoptim.curvatureNumerator().zeros();
var sequenceDiffEventsOptim = this.generateSequenceDifferentialEvents(curvatureExtremaLocationsOptim, inflectionLocationsOptim);
//console.log("Event(s) optim: ", JSON.parse(JSON.stringify(sequenceDiffEventsOptim)))
console.log("Event(s) optim: ", JSON.parse(JSON.stringify(sequenceDiffEventsOptim)));
var neighboringEvents = [];
if (this.curveSceneController.controlOfCurvatureExtrema && this.curveSceneController.controlOfInflection) {
if (sequenceDiffEventsInit.length >= sequenceDiffEventsOptim.length) {
@@ -39911,13 +39945,13 @@ function main() {
}
function keyDown(ev) {
var keyName = ev.key;
console.log(keyName + " domn");
//console.log(keyName + " down")
if (keyName === "Shift")
sceneController.shiftKeyDown();
}
function keyUp(ev) {
var keyName = ev.key;
console.log(keyName + " up");
//console.log(keyName + " up")
if (keyName === "Shift")
sceneController.shiftKeyUp();
}
2 changes: 1 addition & 1 deletion dist/bundle.js.map

Large diffs are not rendered by default.

36 changes: 31 additions & 5 deletions src/controllers/SlidingStrategy.ts
Original file line number Diff line number Diff line change
@@ -389,13 +389,23 @@ export class SlidingStrategy implements CurveControlStrategyInterface {
} else if(inflectionIndices.length - inflectionIndicesOptim.length === 1) {
/* JCL One inflection has been lost -> case of inflection gone outside the curve through one extremity */
if(orderedDifferentialEvents[0].event === DiffEventType.inflection && orderedDifferentialEventsOptim.length === 0) {
result.push({event: NeighboringEventsType.neighboringInflectionLeftBoundary, index: 0})
let intervalExtrema = []
intervalExtrema.push(orderedDifferentialEvents[0].loc)
if(orderedDifferentialEvents.length === 1) {
intervalExtrema.push(1.0 - orderedDifferentialEvents[0].loc)
} else throw new Error("Inconsistent content of the sequence of events to identify the curve extremity where the inflection is lost.")

if(intervalExtrema[0] > intervalExtrema[intervalExtrema.length - 1]) {
result.push({event: NeighboringEventsType.neighboringInflectionRightBoundary, index: 0})
} else
result.push({event: NeighboringEventsType.neighboringInflectionLeftBoundary, index: 0})

} else if(orderedDifferentialEvents[0].event === DiffEventType.inflection && orderedDifferentialEventsOptim[0].event !== DiffEventType.inflection) {
result.push({event: NeighboringEventsType.neighboringInflectionLeftBoundary, index: 0})
} else if(orderedDifferentialEvents[orderedDifferentialEvents.length - 1].event === DiffEventType.inflection && orderedDifferentialEventsOptim[orderedDifferentialEventsOptim.length - 1].event !== DiffEventType.inflection) {
result.push({event: NeighboringEventsType.neighboringInflectionRightBoundary, index: orderedDifferentialEvents.length - 1})
} else {
throw new Error("Inconsistent content of the sequence of event to identify the loss of an inflection at a curve extremity.")
throw new Error("Inconsistent content of the sequence of events to identify the loss of an inflection at a curve extremity.")
}
} else if(orderedDifferentialEvents.length - orderedDifferentialEventsOptim.length === 2 && inflectionIndices.length - inflectionIndicesOptim.length === 2) {
/* JCL Two inflections meet at one curvature extrema and these two are lost -> case of oscillation removal */
@@ -416,7 +426,10 @@ export class SlidingStrategy implements CurveControlStrategyInterface {
refEventLocationOptim.push(i)
}
}
if(refEventLocationOptim.length !== refEventLocation.length - 1 && inflectionIndicesOptim.length !== inflectionIndices.length - 2) {
if(inflectionIndicesOptim.length !== inflectionIndices.length - 2 &&
((refEventLocationOptim.length !== refEventLocation.length - 1 && refEventLocation.length === 1) ||
(refEventLocationOptim.length !== refEventLocation.length - 2 && refEventLocation.length > 1) ||
(refEventLocationOptim.length !== refEventLocation.length - 3 && refEventLocation.length > 2) )) {
throw new Error("Inconsistency of reference type event that does not coincide with oscillation removal.")
} else {
let intervalEvent: Array<number> = []
@@ -430,6 +443,19 @@ export class SlidingStrategy implements CurveControlStrategyInterface {
for(let j = 0; j < refEventLocationOptim.length - 1; j += 1) {
intervalEventOptim.push(refEventLocationOptim[j + 1] - refEventLocationOptim[j])
}
} else {
if(refEventLocation.length === 1) result.push({event: NeighboringEventsType.neighboringInflectionsCurvatureExtremum, index: refEventLocation[0]})
if(refEventLocation.length === 2) {
if(orderedDifferentialEventsOptim[refEventLocation[0]].event === DiffEventType.inflection) result.push({event: NeighboringEventsType.neighboringInflectionsCurvatureExtremum, index: refEventLocation[1]})
else result.push({event: NeighboringEventsType.neighboringInflectionsCurvatureExtremum, index: refEventLocation[0]})
}
if(refEventLocation.length === 3) {
if(orderedDifferentialEventsOptim[refEventLocation[0]].event === DiffEventType.inflection &&
orderedDifferentialEventsOptim[refEventLocation[1]].event === DiffEventType.inflection) result.push({event: NeighboringEventsType.neighboringInflectionsCurvatureExtremum, index: refEventLocation[2]})
else if(orderedDifferentialEventsOptim[refEventLocation[0]].event === DiffEventType.inflection &&
orderedDifferentialEventsOptim[refEventLocation[1]].event !== DiffEventType.inflection) result.push({event: NeighboringEventsType.neighboringInflectionsCurvatureExtremum, index: refEventLocation[1]})
else result.push({event: NeighboringEventsType.neighboringInflectionsCurvatureExtremum, index: refEventLocation[0]})
}
}

for(let k = 0; k < intervalEventOptim.length; k += 1) {
@@ -460,7 +486,7 @@ export class SlidingStrategy implements CurveControlStrategyInterface {
const curvatureExtremaLocations = splineDP.curvatureDerivativeNumerator().zeros()
const inflectionLocations = splineDP.curvatureNumerator().zeros()
let sequenceDiffEventsInit: Array<DifferentialEvent> = this.generateSequenceDifferentialEvents(curvatureExtremaLocations, inflectionLocations)
//console.log("Event(s): ", JSON.parse(JSON.stringify(sequenceDiffEventsInit)))
console.log("Event(s): ", JSON.parse(JSON.stringify(sequenceDiffEventsInit)))

/*console.log("optimize: inits0X " + this.curveModel.spline.controlPoints[0].x + " inits0Y " + this.curveModel.spline.controlPoints[0].y + " ndcX " + ndcX + " ndcY " + ndcY )*/
this.curveModel.setControlPoint(selectedControlPoint, ndcX, ndcY)
@@ -482,7 +508,7 @@ export class SlidingStrategy implements CurveControlStrategyInterface {
let curvatureExtremaLocationsOptim = splineDPoptim.curvatureDerivativeNumerator().zeros()
let inflectionLocationsOptim = splineDPoptim.curvatureNumerator().zeros()
let sequenceDiffEventsOptim: Array<DifferentialEvent> = this.generateSequenceDifferentialEvents(curvatureExtremaLocationsOptim, inflectionLocationsOptim)
//console.log("Event(s) optim: ", JSON.parse(JSON.stringify(sequenceDiffEventsOptim)))
console.log("Event(s) optim: ", JSON.parse(JSON.stringify(sequenceDiffEventsOptim)))
let neighboringEvents: Array<NeighboringEvents> = []
if(this.curveSceneController.controlOfCurvatureExtrema && this.curveSceneController.controlOfInflection) {
if(sequenceDiffEventsInit.length >= sequenceDiffEventsOptim.length) {
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -308,13 +308,13 @@ export function main() {

function keyDown(ev: KeyboardEvent) {
const keyName = ev.key
console.log(keyName + " domn")
//console.log(keyName + " down")
if(keyName === "Shift") sceneController.shiftKeyDown()
}

function keyUp(ev: KeyboardEvent) {
const keyName = ev.key
console.log(keyName + " up")
//console.log(keyName + " up")
if(keyName === "Shift") sceneController.shiftKeyUp()
}