User:GregoryLi/GSoC2022/FinalReport

From BRL-CAD
< User:GregoryLi
Revision as of 10:58, 10 October 2022 by GregoryLi (talk | contribs) (Created page with "= brep_primitives_intersection project to test primitives intersection and brep cases = branch: https://github.com/GregoryLi0/brlcad/tree/brep_arb8intersect The project int...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

brep_primitives_intersection project to test primitives intersection and brep cases[edit]

branch: https://github.com/GregoryLi0/brlcad/tree/brep_arb8intersect

The project intends to test if the intersection and brep functions are correct.

It creates one primitive intersection matrix, then converts all intersection cases into brep format. Now we have arb8 and sph primitives available. Either of them have 125 cases with different relative positions, each case have two primitives. They are converted into brep format with three kind of union format: OP_UNION, OP_INTERSECT and OP_SUBTRACT.

All the primitives data are stored and caculated in brep_primitives_intersection.h, and the brep_conversion functions are copied from libged.

Arb matrix primitives.PNG Arb matrix brep.PNG

primitives brep converting[edit]

branch: https://github.com/GregoryLi0/brlcad/tree/brep_rhc_debug

The project intends to test if all the primitives can be converted into brep format correctly.

This project creates all the solid primitives and converts them into brep format. Each of the primitives is given a default rotation. Two primitives got wrong answer. But they are fixed now.

Primitives matrix.PNG

primitives brep debugging[edit]

branch: https://github.com/GregoryLi0/brlcad/tree/brep_rhc_debug && https://github.com/GregoryLi0/brlcad/tree/brep_epa_debug

rhc[edit]

Converting rhc into brep get wrong side face and botton faces. The reason is about nurbs and Casteljau formula in rt_rhc_brep function.

Rhc prev.PNGRhc after.PNG

epa[edit]

Epa’s Upper nurbs surface have no translation before. It’s solved by caculating a translation matrix and applying to the upper nurbs surface.

Epa primitive.PNG

dplot cmd debug[edit]

branch: https://github.com/GregoryLi0/brlcad/tree/dplot_debug

The dplot calls overlay cmd to plot files, but the commands given by dplot can’t call overlay cmd correctly. So I change the parameters transfered to overlay and files plotted.

However, some of the plot files can’t be plotted normally. I still don’t know what goes wrong. Some files to be plotted are modified they can be displayed successfully.

brep and boolean functions[edit]

note: debugging at commit 8a508c8f.

Locate the error that the trimmed faces are not generated and stored correctly. If we trim one surface with a closed curve, we should get two subsurfaces,but we only get one now.

Here is one explanation for the error. I created two arb8 and convert the union to brep form. I keep all the subsurfaces no matter it should be kept or not. If everything works correct, we shall get two arb8 with trim lines. But now we get one subface for every origin face.

Brep faces.PNG

To fix it, we shall get all the subfaces created by the boolean operation, then decide whether to keep them or not. The key functions is get_evaluated_faces() in src/libbrep/boolean.cpp.