Skip to content

Commit bce42f6

Browse files
committed
[ellips] minor update (merging branches)
2 parents 51b30d6 + 8a1121a commit bce42f6

File tree

78 files changed

+3120
-966
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+3120
-966
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
endif()
5757

5858
if(MSVC)
59-
#add_compile_options(/W4 /WX) # temporarily removed because of multiple "the following warning is treated as an error" with WS
59+
add_compile_options(/W4)
6060
else()
6161
add_compile_options(-Wall -Wextra -Wpedantic)
6262
endif()

doc/CMakeLists.txt

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,53 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mathjax_stmaryrd.js
5252

5353
endif()
5454

55+
endif()
56+
57+
# User manual (Sphinx)
58+
59+
find_package(Sphinx)
60+
61+
if(NOT SPHINX_FOUND)
62+
63+
message(STATUS "Sphinx not found, will not be able to generate the manual.")
64+
65+
else()
66+
67+
# Includes CMake commands in config file:
68+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/manual/conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/manual/conf.py)
69+
70+
set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/manual)
71+
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/manual)
72+
73+
# Copying _static files of Sphinx to build directories
74+
foreach(static_file ${CMAKE_CURRENT_SOURCE_DIR}/manual/_static/)
75+
file(COPY ${static_file} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/manual/_static/)
76+
endforeach()
77+
78+
# Copying tmp files
79+
foreach(static_file ${CMAKE_CURRENT_SOURCE_DIR}/manual/tmp/)
80+
file(COPY ${static_file} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/manual/tmp/)
81+
endforeach()
82+
83+
# todo: the SPHINX_EXECUTABLE is already set by FindSphinx.cmake:
84+
# check that it works without the following overload for Win and Linux:
85+
if(WIN32)
86+
set(SPHINX_EXECUTABLE "sphinx-build")
87+
else()
88+
set(SPHINX_EXECUTABLE "python3" "-msphinx")
89+
endif()
90+
91+
add_custom_target(manual
92+
COMMAND
93+
${SPHINX_EXECUTABLE} -b html
94+
# Specifying path to conf.py generated by CMake:
95+
-c ${CMAKE_CURRENT_BINARY_DIR}/manual/
96+
${SPHINX_SOURCE} ${SPHINX_BUILD}
97+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
98+
COMMENT "Generating the manual website using Sphinx")
99+
100+
install(DIRECTORY ${SPHINX_BUILD}/
101+
DESTINATION share/manual/${CMAKE_PROJECT_NAME}
102+
OPTIONAL)
103+
55104
endif()

doc/manual/_static/css/custom.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
div.rst-content a:visited
2+
{
3+
color: #2980b9;
4+
text-decoration: none;
5+
}
6+
7+
div.rst-content li.toctree-l1 > a
8+
{
9+
font-weight: bold;
10+
}

doc/manual/_static/empty.txt

Whitespace-only changes.

doc/manual/_templates/empty.txt

Whitespace-only changes.

doc/manual/conf.py.in

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
# -- Project information -----------------------------------------------------
7+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8+
9+
project = 'Codac'
10+
copyright = 'Codac Team'
11+
author = 'Codac Team'
12+
13+
# -- General configuration ---------------------------------------------------
14+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
15+
16+
extensions = [
17+
'sphinx_rtd_theme',
18+
]
19+
20+
templates_path = ['_templates']
21+
exclude_patterns = []
22+
23+
24+
# -- Options for HTML output -------------------------------------------------
25+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
26+
27+
html_static_path = ['_static']
28+
html_theme = "sphinx_rtd_theme"
29+
html_logo = "_static/logos/logo_codac.svg"
30+
31+
# These paths are either relative to html_static_path
32+
# or fully qualified paths (eg. https://...)
33+
html_css_files = [
34+
'css/custom.css',
35+
]
36+
37+
html_theme_options = {
38+
'logo_only': True,
39+
'display_version': True,
40+
}

doc/manual/index.rst

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
Codac manual
2+
============
3+
4+
5+
.. toctree::
6+
:caption: Overview of Codac
7+
:maxdepth: 3
8+
9+
Constraint programming and IA <http://codac.io>
10+
The Codac framework <http://codac.io>
11+
Target audience <http://codac.io>
12+
13+
14+
.. toctree::
15+
:caption: User manual
16+
:maxdepth: 3
17+
18+
installation/index.rst
19+
intervals/index.rst
20+
linear/index.rst
21+
functions/index.rst
22+
tubes/index.rst
23+
contractors/index.rst
24+
separators/index.rst
25+
pavers/index.rst
26+
cn/index.rst
27+
geometry/index.rst
28+
ellipsoids/index.rst
29+
topology/index.rst
30+
visualization/index.rst
31+
extensions/index.rst
32+
seealso/index.rst
33+
references/index.rst
34+
35+
36+
.. toctree::
37+
:caption: How-to guides
38+
:maxdepth: 3
39+
40+
howto/robotics/index.rst
41+
howto/geometry/index.rst
42+
howto/dynamical/index.rst
43+
44+
45+
.. toctree::
46+
:caption: Development
47+
:maxdepth: 3
48+
49+
Changelog <http://codac.io>
50+
C++ API <http://codac.io>
51+
Information for developers <http://codac.io>

doc/manual/tmp/empty.txt

Whitespace-only changes.

examples/00_graphics/graphic_examples.py

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
fig1.set_window_properties([50,50],[500,500]) # position, window size
2424
fig1.set_axes(axis(0,[-10,10]), axis(1,[-10,10])) # (axis_id,[range_of_values_on_this_axis])
2525
fig1.draw_box([[-1,1],[-1,1]],[Color.green(),Color.red(0.2)]) # drawing a green box with red opacity values inside
26-
fig1.draw_circle([1,1],0.5,Color(255,155,5)) # drawing a circle at (1,1) of radius 0.5 with a custom RGB color
26+
fig1.draw_circle([1,1],0.5,Color([255,155,5])) # drawing a circle at (1,1) of radius 0.5 with a custom RGB color
2727
fig1.draw_ring([1,1],[4,6],Color.red()) # drawing a ring at (1,1) of radius [4,6] with a predefined red color
2828

2929
fig2 = Figure2D("My figure 2", GraphicOutput.VIBES | GraphicOutput.IPE)
@@ -44,5 +44,31 @@
4444
fig2.draw_polygone([[2,4.5],[4,4.5],[4.2,3.5],[3.5,3]], [Color.none(),Color.green(0.5)])
4545
fig2.draw_polyline([[-0.8,0],[0,1.5]], 0.2, [Color.red(),Color.black(0.3)])
4646
fig2.draw_ellipse([1,1],[0.5,2], 0.2, [Color.blue(),Color.blue(0.3)])
47+
48+
# Colors
49+
# predefined colors without and with opacity
4750
fig2.draw_point([2,2], [Color.red(),Color.yellow(0.5)])
48-
fig2.draw_box([[2.4,2.9],[2.4,2.9]],[Color("#da3907"),Color("#da390755")])
51+
# HTML color without and with opacity
52+
fig2.draw_box([[2.4,2.9],[2.4,2.9]],[Color("#da3907"),Color("#da390755")])
53+
# HSV color without and with opacity
54+
fig2.draw_box([[2.6,3.1],[2.6,3.1]],[Color([108,90,78],Model.HSV),Color([108,90,78,20],Model.HSV)])
55+
# RGB color auto cast from list without and with opacity
56+
fig2.draw_box([[2.,2.3],[2.6,2.9]],[[255,0,255],[255,0,255,100]])
57+
58+
fig3 = Figure2D("ColorMap figure", GraphicOutput.VIBES | GraphicOutput.IPE)
59+
fig3.set_axes(axis(0,[-1,21]), axis(1,[-5.5,0.5]))
60+
fig3.set_window_properties([800,250],[500,500])
61+
62+
cmap_haxby=ColorMap.haxby()
63+
cmap_default=ColorMap.basic()
64+
cmap_blue_tube=ColorMap.blue_tube()
65+
cmap_red_tube=ColorMap.red_tube()
66+
cmap_rainbow=ColorMap.rainbow()
67+
68+
for i in range (20):
69+
ratio=i/20
70+
fig3.draw_box([[i,i+1],[-1,0]],[Color.black(),cmap_haxby.color(ratio)])
71+
fig3.draw_box([[i,i+1],[-2,-1]],[Color.black(),cmap_default.color(ratio)])
72+
fig3.draw_box([[i,i+1],[-3,-2]],[Color.black(),cmap_blue_tube.color(ratio)])
73+
fig3.draw_box([[i,i+1],[-4,-3]],[Color.black(),cmap_red_tube.color(ratio)])
74+
fig3.draw_box([[i,i+1],[-5,-4]],[Color.black(),cmap_rainbow.color(ratio)])

examples/ellipsoid_dev/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ int main() {
6363
// ----------------------------------------------------------
6464

6565
// step 1 identify the direction of non inclusion
66-
Eigen::MatrixXd X = e4.G._e;
67-
Eigen::MatrixXd Y = e6.G._e;
66+
Eigen::MatrixXd X = e4.G;
67+
Eigen::MatrixXd Y = e6.G;
6868
Eigen::MatrixXd Y_inv = Y.inverse();
6969
Eigen::MatrixXd D = Eigen::MatrixXd::Identity(3,3)- X.transpose()*Y_inv.transpose()*Y_inv*X;
7070
cout << "D = " << D << endl;
@@ -84,7 +84,7 @@ int main() {
8484
cout << " the vector associated to the min eigenvalue is " << v << endl;
8585

8686
// select the less included point and draw it on the figures
87-
Eigen::VectorXd x = e4.mu._e+e4.G._e*v;
87+
Eigen::VectorXd x = e4.mu+e4.G*v;
8888
cout << "the point " << x << " is the less included point" << endl;
8989
fig2.draw_point(x, {Color::black()});
9090
fig3.draw_point(x, {Color::black()});

0 commit comments

Comments
 (0)