小编JSM*_*gan的帖子

如何在不加载 json 文件的情况下创建 open3d.visualization.SelectionPolygonVolume 对象

我正在尝试使用 SelectionPolygonVolume 对象裁剪 Open3d 点云。在 Open3d 的 github教程上,SelectionPolygonVolume 是通过调用 从json 文件vol = o3d.visualization.read_selection_polygon_volume("../../TestData/Crop/cropped.json") 构建对象来创建的。

我可以让它运行良好,但如果不先从 json 文件加载它,就无法生成 SelectionPolygonVolume。没有json文件怎么实例化类呢?我浏览了所有文档和在线,但找不到任何东西。

到目前为止,这是我尝试过的:

bounding_polygon = np.array([ 
            [ 2.6509309513852526, 0.0, 1.6834473132326844 ],
                                ...
            [ 2.6579576128816544, 0.0, 1.6819127849749496 ]]).astype("float64")
vol = o3d.visualization.SelectionPolygonVolume()
vol.orthogonal_axis = "Y"
vol.axis_max = 4.022921085357666
vol.axis_min = -0.76341366767883301
vol.bounding_polygon = bounding_polygon
Run Code Online (Sandbox Code Playgroud)

但它会引发以下错误(调用时vol.bounding_polygon = bounding_polygon):

TypeError: (): incompatible function arguments. The following argument types are supported:
    1. (self: open3d.open3d.visualization.SelectionPolygonVolume, arg0: open3d.open3d.utility.Vector3dVector) -> None

Invoked with: visualization::SelectionPolygonVolume, access its …
Run Code Online (Sandbox Code Playgroud)

python open3d

2
推荐指数
1
解决办法
3691
查看次数

Java并发修改递归行为

我正在编写一个java程序来解决Tricky Triangles(在三角形上像游戏一样检查 - 这是规则,并且是一张照片在此输入图像描述)

该程序通过所有可能的移动进行交互,递归地进行移动,然后迭代新的可能移动等等,直到找到基本案例.

基本情况如下:

  1. 可能的移动次数= 0

我的代码

UPDATED(2/26/2017)解决并发修改错误 public int stackSolve(Triangle inputTriangle,Stack stackIn,int depth)抛出InvalidArgumentException {

    System.out.println("in stackSolve(). current Triangle: ");
    inputTriangle.printTriangle();

    if (inputTriangle.possibleMoves.size() ==0){

        System.out.println("num possible moves: 0");

        if (inputTriangle.nonNonEmptySpots() == 1){
            System.out.println("Winning solution found.");
            return 1;
        }
        else{
            System.out.println("non winning solution found. Going higher in recursion tree");
            return 0;
        }

    }
    else{
        System.out.println("Number of moves: "+inputTriangle.possibleMoves.size());
        for (Move mv : inputTriangle.possibleMoves){

            System.out.println("Making move : "+mv.toString());
            inputTriangle.makeMove(mv);
            System.out.println("move made");
            stackIn.push(mv);

            System.out.println("entering deeper in recursion tree, calling …
Run Code Online (Sandbox Code Playgroud)

java iteration algorithm recursion

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

标签 统计

algorithm ×1

iteration ×1

java ×1

open3d ×1

python ×1

recursion ×1