Ejemplo n.º 1
0
def normalEdgesAlongEdge(edge, length , interval):
	"compute an edge having length at the specified parameter on the supplied curve:"

	edgeList = [];
	
	ew = Wrappers.Edge(edge);
	zDir = gp.gp().DZ();
	zVec = gp.gp_Vec(zDir);
	
	curve = ew.curve;
	pStart = ew.firstParameter;
	pEnd = ew.lastParameter;
	
	for p in Wrappers.frange6(pStart,pEnd,interval):
		tangent = gp.gp_Vec();
		tanpoint = gp.gp_Pnt();
		curve.D1(p,tanpoint,tangent );
		axis = gp.gp_Ax1(tanpoint, gp.gp_Dir(tangent.Crossed(zVec) ) );
	
		line = Geom.Geom_Line(axis );
		e = BRepBuilderAPI.BRepBuilderAPI_MakeEdge(line.GetHandle(),0, length).Edge();	
		if e:
			edgeList.append(e);
			
	return edgeList;
Ejemplo n.º 2
0
def normalEdgeAtParameter(edge, param, length ):
	"compute an edge having length at the specified parameter on the supplied curve:"

	ew = Wrappers.Edge(edge);
	zDir = gp.gp().DZ();
	zVec = gp.gp_Vec(zDir);
	
	tangent = gp.gp_Vec();
	tanpoint = gp.gp_Pnt();
	
	curve = ew.curve;
	curve.D1(param,tanpoint,tangent );
	axis = gp.gp_Ax1(tanpoint, gp.gp_Dir(tangent.Crossed(zVec) ) );
	
	line = Geom.Geom_Line(axis );
	return  BRepBuilderAPI.BRepBuilderAPI_MakeEdge(line.GetHandle(),0, length).Edge();