小编Pra*_*nav的帖子

Travis CI:避免为每次提交重复安装软件包

正如您在此travis.yml文件中看到的,我的代码依赖于某些第三方库,我在构建项目之前将它们安装在远程系统上.

每次推送提交时,Travis都会下载并构建这些库,这可以避免吗?我的意思是,对于一个项目只做一次,之后构建过程使用那些已经构建的库进行后续提交?

git github travis-ci

6
推荐指数
1
解决办法
509
查看次数

确定一个点是否在多面体内

我试图确定特定点是否位于多面体内.在我目前的实现中,我正在研究的方法是我们正在寻找多面体的面数组(在这种情况下为三角形,但稍后可能是其他多边形).我一直在努力从这里找到的信息开始工作:http://softsurfer.com/Archive/algorithm_0111/algorithm_0111.htm

下面,你会看到我的"内部"方法.我知道nrml /正常的东西有点奇怪..它是旧代码的结果.当我运行它时,无论我给出什么输入,它似乎总是返回真实.(这个问题已经解决了,请参阅下面的答案 - 此代码现在正在运行).

bool Container::inside(Point* point, float* polyhedron[3], int faces) {
  Vector* dS = Vector::fromPoints(point->X, point->Y, point->Z,
                 100, 100, 100);
  int T_e = 0;
  int T_l = 1;

  for (int i = 0; i < faces; i++) {
    float* polygon = polyhedron[i];

    float* nrml = normal(&polygon[0], &polygon[1], &polygon[2]);
    Vector* normal = new Vector(nrml[0], nrml[1], nrml[2]);
    delete nrml;

    float N = -((point->X-polygon[0][0])*normal->X + 
                (point->Y-polygon[0][1])*normal->Y +
                (point->Z-polygon[0][2])*normal->Z);
    float D = dS->dot(*normal);

    if (D == 0) {
      if …
Run Code Online (Sandbox Code Playgroud)

c++ 3d polyhedra computational-geometry

4
推荐指数
2
解决办法
9364
查看次数

标签 统计

3d ×1

c++ ×1

computational-geometry ×1

git ×1

github ×1

polyhedra ×1

travis-ci ×1