CGAL+EIGEN+LIBGIL+VS2022配置

以此文来纪念我本科的图形学生涯
Visual studio(确认可以运行c++,例如输出“hello world”)

CGAL配置

(感谢我zc师姐,本教程来自于我师姐,永远爱师姐捏)
安装顺序:
Boost
CGAL
CGAL下载
下载最新版CGAL zip文件 (https://github.com/CGAL/cgal/releases)
在这里插入图片描述
下载红框内的两个文件,解压后得到两个文件夹,如图所示直接拖拽auxiliary到CGAL-5.4文件夹中,覆盖掉auxiliary
在这里插入图片描述
打开“项目-属性”,按照图示填写好路径
在这里插入图片描述
新建cpp文件,拷贝代码,运行后得到对话框,验证配置成功
在这里插入图片描述

#include <CGAL/IO/io.h>
#include <CGAL/Algebraic_structure_traits.h>
#include <CGAL/number_utils.h>
#include <CGAL/int.h>
template< typename NT > NT unit_part(const NT& x);
template< typename NT >
NT unit_part_(const NT& x, CGAL::Field_tag);
template< typename NT >
NT unit_part_(const NT& x, CGAL::Integral_domain_without_division_tag);
template< typename NT >
NT unit_part(const NT& x) {
    // the unit part of 0 is defined as 1.
    if (x == 0) return NT(1);
    typedef CGAL::Algebraic_structure_traits<NT> AST;
    typedef typename AST::Algebraic_category Algebraic_category;
    return unit_part_(x, Algebraic_category());
}
template< typename NT >
NT unit_part_(const NT& x, CGAL::Integral_domain_without_division_tag) {
    // For many other types the only units are just -1 and +1.
    return NT(int(CGAL::sign(x)));
}
template< typename NT >
NT unit_part_(const NT& x, CGAL::Field_tag) {
    // For Fields every x != 0 is a unit.
    // Therefore, every x != 0 is its own unit part.
    return x;
}
int main() {
    // Function call for a model of EuclideanRing, i.e. int.
    std::cout << "int:    unit_part(-3  ): " << unit_part(-3) << std::endl;
    // Function call for a model of FieldWithSqrt, i.e. double
    std::cout << "double: unit_part(-3.0): " << unit_part(-3.0) << std::endl;
    return 0;
}
// Note that this is just an example
// This implementation for unit part won't work for some types, e.g.,
// types that are not RealEmbeddable or types representing structures that have
// more units than just -1 and +1. (e.g. MP_Float representing Z[1/2])
// From there Algebraic_structure_traits provides the functor Unit_part.

EIGEN配置

下载链接:
https://eigen.tuxfamily.org/index.php?title=Main_Page
Eigen不需要构建任何东西来安装。 只需将 eigen 添加到vs项目的包含路径并包含相关的标头(具体见"最后的配置结果")。

LIBGIL

下载链接:https://github.com/libigl/libigl/r在这里插入图片描述
eleases/tag/v2.4.0
在这里插入图片描述
Libigl 是一个只有头文件的库。 不需要构建任何东西来安装。 只需将 libigl/include 添加到vs项目的包含路径并包含相关的标头(具体见"最后的配置结果")。

最后的配置结果

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值