MCPcopy
hub / github.com/CadQuery/cadquery / segment

Function segment

cadquery/occ_impl/shapes.py:6254–6261  ·  view source on GitHub ↗

Construct a segment from two points.

(p1: VectorLike, p2: VectorLike)

Source from the content-addressed store, hash-verified

6252
6253
6254def segment(p1: VectorLike, p2: VectorLike) -> Edge:
6255 """
6256 Construct a segment from two points.
6257 """
6258
6259 return _shape(
6260 BRepBuilderAPI_MakeEdge(Vector(p1).toPnt(), Vector(p2).toPnt()).Edge(), Edge
6261 )
6262
6263
6264def polyline(*pts: VectorLike) -> Wire:

Callers 15

test_edge_paramAtFunction · 0.90
test_trimmingFunction · 0.90
test_sampleFunction · 0.90
test_start_endFunction · 0.90
test_name_geometriesFunction · 0.90
test_show_nurbsFunction · 0.85
test_constructorsFunction · 0.85
test_segmentFunction · 0.85
test_operatorsFunction · 0.85
test_extrudeFunction · 0.85
test_offset2DFunction · 0.85

Calls 3

_shapeFunction · 0.85
VectorClass · 0.85
toPntMethod · 0.80

Tested by 15

test_edge_paramAtFunction · 0.72
test_trimmingFunction · 0.72
test_sampleFunction · 0.72
test_start_endFunction · 0.72
test_name_geometriesFunction · 0.72
test_show_nurbsFunction · 0.68
test_constructorsFunction · 0.68
test_segmentFunction · 0.68
test_operatorsFunction · 0.68
test_extrudeFunction · 0.68
test_offset2DFunction · 0.68