Comments (2)
would you be able to make a script to reproduce the problem?
from pythonocc-utils.
Yup sure here is the code
from OCC.gp import gp_Pnt
from OCC.BRepBuilderAPI import BRepBuilderAPI_MakePolygon, BRepBuilderAPI_MakeFace, BRepBuilderAPI_MakeEdge
from OCCUtils import edge
def make_edge(pypt1, pypt2):
gp_point1 = gp_Pnt(pypt1[0], pypt1[1], pypt1[2])
gp_point2 = gp_Pnt(pypt2[0], pypt2[1], pypt2[2])
make_edge = BRepBuilderAPI_MakeEdge(gp_point1, gp_point2)
return make_edge.Edge()
def make_polygon(pyptlist):
array = []
for pt in pyptlist:
array.append(gp_Pnt(pt[0],pt[1],pt[2]))
poly = BRepBuilderAPI_MakePolygon()
map(poly.Add, array)
poly.Build()
poly.Close()
wire = poly.Wire()
occface = BRepBuilderAPI_MakeFace(wire)
return occface.Face()
#point to be projected
orig_pnt = gp_Pnt(0, 0, 10)
#edge to be projected to
dest_edge = make_edge((50,100,0), (50,20,0))
occutil_edge = edge.Edge(dest_edge)
#project point to edge
u, projpt = occutil_edge.project_vertex(orig_pnt)
#face the edge will intersect with
inter_face = make_polygon(((30,75,0),(60,75,0),(60,75,50),(30,75,50)))
#intersect edge with face
interptlist = occutil_edge.Intersect.intersect(inter_face, 1e-2)
from pythonocc-utils.
Related Issues (12)
- lack of CI integration HOT 1
- installing pythonocc-utils in pythonocc conda environment: "no module named Common" HOT 2
- issues when running the example occutils_geomplate.py HOT 1
- No packaged version available
- Measurement of CAD file HOT 10
- OCCUtils, Common, point_in_solid Function Issue
- Error in Common/smooth_pnts function
- Runtime error in edge.py
- How to Extract center point coordinate of a solid from a STEP file
- Curvature Calculation Inaccurate for B-Spline Curves in DiffGeomCurve Class
- -
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pythonocc-utils.