From ca159ae8478cf20dfe5a0d7c0d677af11b08b833 Mon Sep 17 00:00:00 2001 From: Pieter Hijma Date: Tue, 14 Nov 2023 17:02:34 +0100 Subject: [PATCH] Improve the documentation of HLRBRep.Algo --- src/Mod/Part/App/HLRBRep/HLRBRep_AlgoPy.xml | 115 ++++++++++++++++---- 1 file changed, 93 insertions(+), 22 deletions(-) diff --git a/src/Mod/Part/App/HLRBRep/HLRBRep_AlgoPy.xml b/src/Mod/Part/App/HLRBRep/HLRBRep_AlgoPy.xml index ec0bb0238f..c3df82e957 100644 --- a/src/Mod/Part/App/HLRBRep/HLRBRep_AlgoPy.xml +++ b/src/Mod/Part/App/HLRBRep/HLRBRep_AlgoPy.xml @@ -14,99 +14,170 @@ Delete="false"> - Describes functions to use HLR algorithm. + A framework to compute a shape as seen in a projection +plane. This is done by calculating the visible and the hidden parts +of the shape. HLRBRep_Algo works with three types of entity: + +- shapes to be visualized +- edges in these shapes (these edges are the basic entities which will be + visualized or hidden), and +- faces in these shapes which hide the edges. + +HLRBRep_Algo is based on the principle of comparing each edge of the shape to +be visualized with each of its faces, and calculating the visible and the +hidden parts of each edge. For a given projection, HLRBRep_Algo calculates a +set of lines characteristic of the object being represented. It is also used in +conjunction with the HLRBRep_HLRToShape extraction utilities, which reconstruct +a new, simplified shape from a selection of calculation results. This new shape +is made up of edges, which represent the shape visualized in the +projection. HLRBRep_Algo takes the shape itself into account whereas +HLRBRep_PolyAlgo works with a polyhedral simplification of the shape. When you +use HLRBRep_Algo, you obtain an exact result, whereas, when you use +HLRBRep_PolyAlgo, you reduce computation time but obtain polygonal segments. In +the case of complicated shapes, HLRBRep_Algo may be time-consuming. An +HLRBRep_Algo object provides a framework for: + +- defining the point of view +- identifying the shape or shapes to be visualized +- calculating the outlines +- calculating the visible and hidden lines of the shape. Warning +- Superimposed lines are not eliminated by this algorithm. +- There must be no unfinished objects inside the shape you wish to visualize. +- Points are not treated. +- Note that this is not the sort of algorithm used in generating shading, which + calculates the visible and hidden parts of each face in a shape to be + visualized by comparing each face in the shape with every other face in the + same shape. + + - Adds the shape S to this framework, and - specifies the number of isoparameters nbiso desired in visualizing S. - You may add as many shapes as you wish. Use the function Add once for each shape. + add(S, nbIso=0) + +Adds the shape S to this framework, and specifies the number of isoparameters +nbiso desired in visualizing S. You may add as many shapes as you wish. Use +the function add once for each shape. - Remove the shape S from this framework. + remove(i) + +Remove the shape of index i from this framework. + - return the index of the Shape S and - return 0 if the Shape S is not found. + index(S) -> int + +Return the index of the Shape S and return 0 if the Shape S is not found. + - Nullify all the results of OutLiner from HLRTopoBRep. + outlinedShapeNullify() + +Nullify all the results of OutLiner from HLRTopoBRep. - set the projector. + setProjector(Origin=(0, 0, 0), ZDir=(0,0,0), XDir=(0,0,0), focus=NaN) + +Set the projector. With focus left to NaN, an axonometric projector is +created. Otherwise, a perspective projector is created with focus focus. - This function is a const member function that returns the number of shapes in the collection. - It does not modify the object's state and is used to retrieve the count of shapes. + nbShapes() + +Returns the number of shapes in the collection. It does not modify the +object's state and is used to retrieve the count of shapes. - set to visible all the edges. + showAll(i=-1) + +If i < 1, then set all the edges to visible. +Otherwise, set to visible all the edges of the shape of index i. - hide the Shape S by itself. + hide(i=-1, j=-1) + +If i < 1, hide all of the datastructure. +Otherwise, if j < 1, hide the shape of index i. +Otherwise, hide the shape of index i by the shape of index j. - set to hide all the edges of the Shape S. + hideAll(i=-1) + +If i < 1, hide all the edges. +Otherwise, hide all the edges of shape of index i. - own hiding of all the shapes of the DataStructure - without hiding by each other. + partialHide() + +Own hiding of all the shapes of the DataStructure without hiding by each other. - select all the DataStructure. + select(i=-1) + +If i < 1, select all the DataStructure. +Otherwise, only select the shape of index i. - select only the edges of the Shape S + selectEdge(i) + +Select only the edges of the shape of index i. - select only the faces of the Shape S. + selectFace(i) + +Select only the faces of the shape of index i. - init the status of the selected edges depending of - the back faces of a closed shell. + initEdgeStatus() + +Init the status of the selected edges depending of the back faces of a closed +shell. - update the DataStructure. + update() + +Update the DataStructure.