Example 2 ========= __Note that this description focuses on the C++ implementation given in the main file `example2.cc`, but in `example2.py` it is illustrated how to realize this example using the Frackit python bindings.__

As you can see, when the internal representation of cylindrical surfaces is used, the result is a single intersection edge, while this edge is split into two sub-edges in case the OpenCascade representation is used. As a result, when evaluating the constraints against the OpenCascade representation of the cylindrical surface, the constraint on the minimum allowed length of intersection edges is checked for each sub-edge. Thus, this approach should be preferred when using cylindrical domains in order to detect small length scales originating from intersections with the auxiliary edge used by OpenCascade. This is important because ultimately, when the network and the domain are fragmented and written into a CAD file, the OpenCascade representation is used. Moreover, we want to reject all those quadrilaterals of which only a very small portion is inside the cylinder. This is done in the lines ```cpp const auto containedArea = computeContainedMagnitude(quad, domain); // reject if this is too small (< 0.01 m^2) if (containedArea < 0.01) { status.increaseRejectedCounter(); continue; } ``` where `computeContainedMagnitude()` is a free function that returns the length/area/volume of the part of a geometry that is contained inside of another geometry. Finally, after the desired number of entities has been created, we cast the entities into an instance of the class `ContainedEntityNetwork`, using the corresponding builder class: ```cpp ContainedEntityNetworkBuilder

In such a case, the constraint on the minimum allowed length of intersection segments might be fulfilled when checked on the raw entities, but might not be fulfilled on the final geometry after confinement of all entities to the domain. In order to overcome this, one can also evaluate the constraints on the confined entities, and thus, using the final geometry of an entity after its confinement. This could be achieved by adjusting the part of the code of this example where the constraints are evaluated in the following way: ```cpp auto quad = sampleIntoSet1 ? quadSampler1() : quadSampler2(); auto& entitySet = sampleIntoSet1 ? entitySet1 : entitySet2; const auto& otherEntitySet = sampleIntoSet1 ? entitySet2 : entitySet1; // get the face(s) that describe(s) the part of the entity that is contained in the domain using namespace OCCUtilities; const auto containedShape = intersect(getShape(quad), getShape(domain), /*epsilon*/1e-6); const auto containedFaces = getFaces(containedShape); // check constraints for all faces making up the contained part if (!constraintsOnSelf.evaluate(entitySet, containedFaces)) { status.increaseRejectedCounter(); continue; } if (!constraintsOnOther.evaluate(otherEntitySet, containedFaces)) { status.increaseRejectedCounter(); continue; } ``` Note that the variable `containedFaces` is of type `std::vector