Skip to content

[zonotope] added operator+ and renamed center c, [graphics] possibility to choose origin for axes, [ctc] Adding CtcParallelepiped with tests and doc#379

Merged
SimonRohou merged 10 commits into
codac-team:codac2_devfrom
godardma:codac2_dev
May 12, 2026

Conversation

@godardma
Copy link
Copy Markdown
Collaborator

No description provided.

@godardma
Copy link
Copy Markdown
Collaborator Author

godardma commented May 5, 2026

I forgot that the PR was opened, the graphical update was not supposed to be in it. The python binding of draw_axes requires a fix before the PR is merged.

@godardma godardma changed the title [zonotope] added operator+ and renamed center c [zonotope] added operator+ and renamed center c, [graphics] possibility to choose origin for axes, [ctc] Adding CtcParallelepiped with tests and doc May 6, 2026
@godardma
Copy link
Copy Markdown
Collaborator Author

godardma commented May 6, 2026

The issue with the python bindings is now solved. I also added the CtcParallelepiped to this PR.

Comment thread doc/manual/manual/contractors/geometric/ctcparallelepiped.rst Outdated
Comment thread doc/manual/manual/contractors/geometric/src.cpp Outdated
Comment thread doc/manual/manual/contractors/geometric/src.py Outdated
Comment thread python/src/core/contractors/codac2_py_CtcParallelepiped.cpp Outdated
Comment thread python/src/graphics/figures/codac2_py_Figure3D.cpp
Comment thread src/core/contractors/codac2_CtcParallelepiped.cpp Outdated
@@ -0,0 +1,45 @@
/**
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of creating this specific contractor, you can simply define the method IntervalVector Parallelepiped::operator&(const IntervalVector& x) const as in https://github.com/codac-team/codac/blob/codac2/src/core/domains/paving/codac2_Paving.h#L153-L171

..which enables CtcWrapper specialization for Parallelepiped :
https://github.com/codac-team/codac/blob/codac2/src/core/contractors/codac2_CtcWrapper.h#L32

(and so the CtcParallelepiped.* files are not useful anymore)

The operator& could also be used for other purposes, so it would be nice to have it too.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with that. I only have a a small question / remark about the & operator.
Since it is "directionnal" would it be possible to define two different operator& ? The intersection of a Parallelepiped and an IntervalVector would give a Parallelepiped, and the interesection of an IntervalVector and a Parallelepiped would give an IntervalVector. Said differently, the type of the first element would prevail.
It would require a minor change in the CtcWrapper, where
x = _y & x;
would become
x = x & _y;

Comment thread tests/core/contractors/codac2_tests_CtcParallelepiped.cpp Outdated
@SimonRohou SimonRohou merged commit 974ee29 into codac-team:codac2_dev May 12, 2026
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants