mcquay239 / cg Goto Github PK
View Code? Open in Web Editor NEWThis project forked from andreyg/geometry-visualization-library
Geometry Visualization Library
This project forked from andreyg/geometry-visualization-library
Geometry Visualization Library
In file "cg / include / cg / operations / orientation.h":
Based on your article (http://habrahabr.ru/post/138168/), epsilon should be equal to "(fabs(l) + fabs(r)) * 4 * std::numeric_limits::epsilon();" instead of "(fabs(l) + fabs(r)) * 8 * std::numeric_limits::epsilon();" (becouse real epsilon is two times smaller than stl's).
Error messages:
.../cg/include/cg/primitives/range.h:43:22: error: ‘max’ is not a member of ‘std’
.../cg/include/cg/primitives/range.h:43:46: error: ‘min’ is not a member of ‘std’
Fix: add "#include " to range.h
Почему бы не прикрутить ctest к проекту, ведь это совершенно бесплатно делается в нашем случае. Получим замечательную систему запуска всех или выборочных тестов прямо из папки build.
New structure:
Repo/
include/
cg/
visualization/
src/
tests/
examples/
Builds libcg, libvisualization, examples (optionally) and tests (optionally)
Provides findcg.cmake
Привет! :)
Видимо эту строку
cg/include/cg/operations/orientation.h
Line 50 in f93f33d
#if defined(_MSC_VER) && (defined(_M_X64) || (defined(_M_IX86_FP) && (_M_IX86_FP > 0)))
// This is because MSVC compiler (2015) has SSE enabled by default for x64, and thus rounding mode can't be saved and should be specified each time
// See also:
// https://www.gecode.org/users-archive/2016-May/004862.html
// https://github.com/Gecode/gecode/blob/7390b0b16bd7cc0cc385f3e8fd9436ca9897d065/gecode/float.hh#L131-L147
typedef boost::numeric::interval_lib::save_state<boost::numeric::interval_lib::rounded_arith_std<T>> RoundingBase;
#else
// Faster version thanks to saving rounding mode in state, also surprisingly rounded_arith_std leads to failed tests on GCC 5.4.0
typedef boost::numeric::interval_lib::rounded_arith_opp<T> RoundingBase;
#endif
typedef boost::numeric::interval_lib::checking_strict<T> CheckingBase;
typedef boost::numeric::interval<double, boost::numeric::interval_lib::policies<RoundingBase, CheckingBase>> interval;
т.к. MSVC 2015 под x64 по умолчанию использует SSE2 (выдержка из https://www.gecode.org/users-archive/2016-May/004862.html):
if you look at the documentation
homepage, you'll see a big red warning :)http://www.boost.org/doc/libs/1_61_0/libs/numeric/interval/doc/interval.htm
which says that the library probably won't work with SSE2 (or at least not
out of the box). But SSE2 is the only option for x64.On the other hand, I'm not aware of any good alternative to this Boost
library. I think the library is actually quite good (even though it would
use some work on supporting SSE2 better).So I thought I'd play with the library's policies to see if I could make it
work with x64. I looked into float.hh which defines what exact interval
datatype is used. It looks like changing from 'rounded_arith_opp' to
'rounded_arith_std' fixes the issues that we're observing. If you're
interested the description of those types is available here:http://www.boost.org/doc/libs/1_61_0/libs/numeric/interval/doc/rounding.htm
Отправил бы PR, но не уверен что ничего не упускаю, т.к. не понимаю две вещи:
P.S. см.:
https://www.gecode.org/users-archive/2016-May/004862.html
https://github.com/Gecode/gecode/blob/7390b0b16bd7cc0cc385f3e8fd9436ca9897d065/gecode/float.hh#L131-L147
P.P.S. понимаю что репозиторий не обновляется, но на всякий случай пусть будет хотя бы Issue
In rectangle_intersects_segment: move the bottom right corner to the left and higher than top left one. Then move the segment into the rectangle. Visualizer will show they do not intersect. Quick fix for rectangle_intersects_segment.cpp:
bool on_release(const point_2f & p)
{
rbutton_pressed_ = false;
+ r_.x = {std::min(r_.x.inf, r_.x.sup), std::max(r_.x.inf, r_.x.sup)};
+ r_.y = {std::min(r_.y.inf, r_.y.sup), std::max(r_.y.inf, r_.y.sup)};
return false;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.