|
Blender V5.3
|
Classes | |
| struct | BooleanError |
| struct | BooleanOpParameters |
| struct | MeshOffsets |
Enumerations | |
| enum class | Solver { MeshArr = 0 , Float = 1 , Manifold = 2 } |
| enum class | Operation { Intersect = 0 , Union = 1 , Difference = 2 } |
| enum class | BooleanErrorType { NoError = 0 , NonManifold = 1 , ResultTooBig = 2 , SolverNotAvailable = 3 , UnknownError = 4 } |
Functions | |
| Mesh * | mesh_boolean (Span< const Mesh * > meshes, Span< float4x4 > transforms, Span< Array< short > > material_remaps, BooleanOpParameters op_params, Solver solver, Vector< int > *r_intersecting_edges, BooleanError *r_error) |
| void | interpolate_corner_attributes (bke::MutableAttributeAccessor output_attrs, bke::AttributeAccessor input_attrs, Mesh *output_mesh, const Mesh *input_mesh, Span< int > out_to_in_corner_map, Span< int > out_to_in_face_map) |
| void | copy_attribute_using_map (GSpan src, Span< int > out_to_in_map, GMutableSpan dst) |
| void | set_material_from_map (Span< int > out_to_in_map, Span< Array< short > > material_remaps, Span< const Mesh * > meshes, const MeshOffsets &mesh_offsets, MutableSpan< int > dst) |
| bke::GeometrySet | join_meshes_with_transforms (Span< const Mesh * > meshes, Span< float4x4 > transforms) |
| int | mesh_id_for_face (int face_id, const MeshOffsets &mesh_offsets) |
| IndexRange | vertex_range_for_face (int face_id, const MeshOffsets &mesh_offsets) |
| Mesh * | mesh_boolean_manifold (Span< const Mesh * > meshes, Span< float4x4 > transforms, Span< Array< short > > material_remaps, BooleanOpParameters op_params, Vector< int > *r_intersecting_edges, BooleanError *r_error) |
Float Boolean | |
| static int | face_boolean_operand (BMFace *f, void *) |
| static BMesh * | mesh_bm_concat (Span< const Mesh * > meshes, Span< float4x4 > transforms, Span< Array< short > > material_remaps, Array< std::array< BMLoop *, 3 > > &r_looptris) |
| static int | operation_to_float_mode (const Operation operation) |
| static Mesh * | mesh_boolean_float (Span< const Mesh * > meshes, Span< float4x4 > transforms, Span< Array< short > > material_remaps, const int boolean_mode, Vector< int > *) |
|
strong |
| Enumerator | |
|---|---|
| NoError | |
| NonManifold | |
| ResultTooBig | |
| SolverNotAvailable | |
| UnknownError | |
Definition at line 41 of file GEO_mesh_boolean.hh.
|
strong |
| Enumerator | |
|---|---|
| Intersect | |
| Union | |
| Difference | |
Definition at line 35 of file GEO_mesh_boolean.hh.
|
strong |
Specifies which solver to use.
| Enumerator | |
|---|---|
| MeshArr | The exact solver based on the Mesh Arrangements for Solid Geometry paper, by Zhou, Grinspun, Zorin, and Jacobson. |
| Float | The original BMesh floating point solver. |
| Manifold | The Manifold library fast robust floating point solver. |
Definition at line 23 of file GEO_mesh_boolean.hh.
| void blender::geometry::boolean::copy_attribute_using_map | ( | GSpan | src, |
| Span< int > | out_to_in_map, | ||
| GMutableSpan | dst ) |
Similar to #attribute_math::gather, but for -1 values in the map, store the default value.
References copy_attribute_using_map().
Referenced by copy_attribute_using_map().
|
static |
Function use to say what operand a face is part of, based on the BM_FACE_TAG which is set in bm_mesh_create.
Definition at line 955 of file geometry/intern/mesh_boolean.cc.
References BM_elem_flag_test, BM_FACE_TAG, and face_boolean_operand().
Referenced by face_boolean_operand(), and mesh_boolean_float().
| void blender::geometry::boolean::interpolate_corner_attributes | ( | bke::MutableAttributeAccessor | output_attrs, |
| bke::AttributeAccessor | input_attrs, | ||
| Mesh * | output_mesh, | ||
| const Mesh * | input_mesh, | ||
| Span< int > | out_to_in_corner_map, | ||
| Span< int > | out_to_in_face_map ) |
Copy attributes on the face corner domain to the output mesh, and for output corners that values that don't have an explicit mapping defined (the maps contain -1 for that element), interpolate the values across the face .
References interpolate_corner_attributes().
Referenced by interpolate_corner_attributes().
| bke::GeometrySet blender::geometry::boolean::join_meshes_with_transforms | ( | Span< const Mesh * > | meshes, |
| Span< float4x4 > | transforms ) |
References join_meshes_with_transforms().
Referenced by join_meshes_with_transforms().
|
static |
Definition at line 976 of file geometry/intern/mesh_boolean.cc.
References blender::Span< T >::begin(), blender::BLI_assert(), blender::bm, BM_elem_flag_enable, blender::BM_FACE, blender::BM_face_normal_flip_ex(), BM_FACE_TAG, blender::BM_FACES_OF_MESH, BM_ITER_MESH, blender::BM_mesh_bm_from_me(), blender::BM_mesh_calc_tessellation_beauty(), blender::BM_mesh_copy_init_customdata_from_mesh_array(), blender::BM_mesh_create(), blender::BM_mesh_elem_table_ensure(), blender::BM_VERTS_OF_MESH, blender::BMeshFromMeshParams::calc_face_normal, blender::BMeshFromMeshParams::calc_vert_normal, blender::CD_MDISPS, blender::BMVert::co, blender::copy_v3_v3(), blender::CustomData_get_offset(), blender::BMesh::ftable, blender::Span< T >::index_range(), blender::IndexRange::IndexRange(), blender::math::is_negative(), blender::BMesh::ldata, blender::BMFace::mat_nr, mesh_bm_concat(), blender::negate_v3(), blender::BMFace::no, blender::normalize_v3(), blender::poly_to_tri_count(), blender::Span< T >::size(), blender::BMAllocTemplate::totedge, blender::BMAllocTemplate::totface, blender::BMesh::totface, blender::BMAllocTemplate::totloop, blender::BMesh::totloop, blender::BMAllocTemplate::totvert, blender::math::transform_direction(), and blender::math::transform_point().
Referenced by mesh_bm_concat(), and mesh_boolean_float().
| Mesh * blender::geometry::boolean::mesh_boolean | ( | Span< const Mesh * > | meshes, |
| Span< float4x4 > | transforms, | ||
| Span< Array< short > > | material_remaps, | ||
| BooleanOpParameters | op_params, | ||
| Solver | solver, | ||
| Vector< int > * | r_intersecting_edges, | ||
| BooleanError * | r_error ) |
Do a mesh boolean operation directly on meshes. Boolean operations operate on the volumes enclosed by the operands. If is only one operand, the non-float versions will do self-intersection and remove internal faces. If there are more than two meshes, the first mesh is operand 0 and the rest of the meshes are operand 1 (i.e., as if all of operands 1, ... are joined into one mesh). The exact solvers assume that the meshes are PWN (piecewise winding number, which approximately means that the meshes are enclosed watertight volumes, and all edges are manifold, though there are allowable exceptions to that last condition). If the meshes don't satisfy those conditions, all solvers will try to use ray-shooting to determine whether particular faces survive or not. This may or may not work in the way the user hopes.
| meshes | The meshes that are operands of the boolean operation. |
| transforms | An array of transform matrices used to transform the input meshes to bring them into the transform space of the result. |
| material_remaps | An array of maps from material slot numbers in the corresponding mesh to the material slot in the first mesh. It is OK for material_remaps or any of its constituent arrays to be empty. A -1 value means that the original index should be used with no mapping. |
| op_params | Specifies the boolean operation and assumptions we can make. |
| solver | which solver to use |
| r_intersecting_edges | Vector to store indices of edges on the resulting mesh in. These 'new' edges are the result of the intersections. |
| r_error | Return place for error to be stored. |
Definition at line 1230 of file geometry/intern/mesh_boolean.cc.
References BLI_assert_unreachable, blender::geometry::boolean::BooleanOpParameters::boolean_mode, Float, Intersect, Manifold, mesh_boolean(), mesh_boolean_float(), mesh_boolean_manifold(), MeshArr, blender::geometry::boolean::BooleanOpParameters::no_self_intersections, NoError, operation_to_float_mode(), blender::Span< T >::size(), SolverNotAvailable, blender::geometry::boolean::BooleanError::type, Union, and blender::geometry::boolean::BooleanOpParameters::watertight.
Referenced by blender::ed::sculpt_paint::trim::apply_trim(), mesh_boolean(), and blender::nodes::node_geo_boolean_cc::node_geo_exec().
|
static |
Definition at line 1110 of file geometry/intern/mesh_boolean.cc.
References blender::BKE_id_free(), blender::BKE_mesh_copy_for_eval(), blender::BKE_mesh_from_bmesh_for_eval_nomain(), blender::BLI_assert(), BLI_assert_unreachable, blender::bm, blender::BM_mesh_free(), blender::BM_mesh_intersect(), blender::IndexRange::drop_back(), face_boolean_operand(), blender::MatBase< float, 4, 4 >::identity(), blender::Span< T >::index_range(), blender::Span< T >::is_empty(), mesh_bm_concat(), mesh_boolean_float(), blender::result, and blender::Span< T >::size().
Referenced by mesh_boolean(), and mesh_boolean_float().
| Mesh * blender::geometry::boolean::mesh_boolean_manifold | ( | Span< const Mesh * > | meshes, |
| Span< float4x4 > | transforms, | ||
| Span< Array< short > > | material_remaps, | ||
| BooleanOpParameters | op_params, | ||
| Vector< int > * | r_intersecting_edges, | ||
| BooleanError * | r_error ) |
References mesh_boolean_manifold().
Referenced by mesh_boolean(), and mesh_boolean_manifold().
| int blender::geometry::boolean::mesh_id_for_face | ( | int | face_id, |
| const MeshOffsets & | mesh_offsets ) |
What mesh_id corresponds to a given face_id, assuming that the face_id is in one of the ranges of mesh_offsets.face_offsets.
References mesh_id_for_face().
Referenced by mesh_id_for_face().
|
static |
Definition at line 1096 of file geometry/intern/mesh_boolean.cc.
References BLI_assert_unreachable, blender::BMESH_ISECT_BOOLEAN_DIFFERENCE, blender::BMESH_ISECT_BOOLEAN_ISECT, blender::BMESH_ISECT_BOOLEAN_NONE, blender::BMESH_ISECT_BOOLEAN_UNION, Difference, Intersect, operation_to_float_mode(), and Union.
Referenced by mesh_boolean(), and operation_to_float_mode().
| void blender::geometry::boolean::set_material_from_map | ( | Span< int > | out_to_in_map, |
| Span< Array< short > > | material_remaps, | ||
| Span< const Mesh * > | meshes, | ||
| const MeshOffsets & | mesh_offsets, | ||
| MutableSpan< int > | dst ) |
The dst span should be the material_index property of the result. Rather than using the attribute from the joined mesh, we want to take the original face and map it using material_remaps.
References set_material_from_map().
Referenced by set_material_from_map().
| IndexRange blender::geometry::boolean::vertex_range_for_face | ( | int | face_id, |
| const MeshOffsets & | mesh_offsets ) |
What is the vertex index range for the face face_id, assuming that face_id is one of the ranges of mesh_offsets.face_offsets.
References vertex_range_for_face().
Referenced by vertex_range_for_face().