Dr. Kavin 2019-06-11 09:36
浏览 271

pythonOCC_array.SetValue(1,1,gp_Pnt(numpy_array[0,0],numpy_array[0,1],numpy_array[0,2]))?

图片说明
from future import division
import math
from OCC.Core.gp import (gp_Pnt, gp_Sphere, gp_Ax3, gp_Dir, gp_Circ, gp_Ax2,
gp_Pnt2d, gp_Dir2d)
from OCC.Core.BRepBuilderAPI import (BRepBuilderAPI_MakeEdge,
BRepBuilderAPI_MakeFace,
BRepBuilderAPI_MakeWire)
from OCC.Core.TColgp import TColgp_Array2OfPnt
from OCC.Core.GeomAPI import GeomAPI_PointsToBSplineSurface
from OCC.Core.GeomAbs import GeomAbs_C2
from OCC.Core.Geom2d import Geom2d_Line
from OCC.Core.BRepLib import breplib_BuildCurves3d
from OCC.Core.Quantity import Quantity_Color, Quantity_NOC_PINK
from OCC.Display.SimpleGui import init_display
import numpy as np
display, start_display, add_menu, add_function_to_menu = init_display()
numpy_array = np.array([[-15,200,10],[5,204,0],[15,200,0],[-15,20,15],[-5,20,0],[15,20,35]])
pythonOCC_array = TColgp_Array2OfPnt(1,3,1,2)
pythonOCC_array.SetValue(1,1,gp_Pnt(numpy_array[0,0],numpy_array[0,1],numpy_array[0,2]))
pythonOCC_array.SetValue(1,2,gp_Pnt(numpy_array[1,0],numpy_array[1,1],numpy_array[1,2]))
pythonOCC_array.SetValue(2,1,gp_Pnt(numpy_array[2,0], numpy_array[2,1],numpy_array[2,2]))
pythonOCC_array.SetValue(2,2,gp_Pnt(numpy_array[3,0], numpy_array[3,1],numpy_array[3,2]))
pythonOCC_array.SetValue(3,1, gp_Pnt(numpy_array[4,0],numpy_array[4,1],numpy_array[4,2]))
pythonOCC_array.SetValue(3,2, gp_Pnt(numpy_array[5,0], numpy_array[5,1],numpy_array[5,2]))
curve = GeomAPI_PointsToBSplineSurface(pythonOCC_array, 3, 8, GeomAbs_C2,0.001).Surface()
sface = BRepBuilderAPI_MakeFace(curve, 1e-6)
display.DisplayColoredShape(sface.Face())
start_display()

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 MATLAB yalmip 可转移负荷的简单建模出错,如何解决?
    • ¥15 数学的三元一次方程求解
    • ¥20 iqoo11 如何下载安装工程模式
    • ¥15 本题的答案是不是有问题
    • ¥15 关于#r语言#的问题:(svydesign)为什么在一个大的数据集中抽取了一个小数据集
    • ¥15 C++使用Gunplot
    • ¥15 这个电路是如何实现路灯控制器的,原理是什么,怎么求解灯亮起后熄灭的时间如图?
    • ¥15 matlab数字图像处理频率域滤波
    • ¥15 在abaqus做了二维正交切削模型,给刀具添加了超声振动条件后输出切削力为什么比普通切削增大这么多
    • ¥15 ELGamal和paillier计算效率谁快?