Revision: 73807
http://sourceforge.net/p/brlcad/code/73807
Author: starseeker
Date: 2019-08-31 18:25:13 +0000 (Sat, 31 Aug 2019)
Log Message:
-----------
At least for now, we'll need singularity information for the surface sampling
logic.
Modified Paths:
--------------
brlcad/trunk/src/libbrep/cdt.h
brlcad/trunk/src/libbrep/cdt2.cpp
Modified: brlcad/trunk/src/libbrep/cdt.h
===================================================================
--- brlcad/trunk/src/libbrep/cdt.h 2019-08-31 16:05:03 UTC (rev 73806)
+++ brlcad/trunk/src/libbrep/cdt.h 2019-08-31 18:25:13 UTC (rev 73807)
@@ -202,8 +202,6 @@
std::map<int, double> *max_edge_seg_len;
std::map<ON_3dPoint *, std::set<BrepTrimPoint *>> *on_brep_edge_pnts;
std::map<int, struct BrepEdgeSegment *> *etrees;
- std::map<int, RTree<void *, double, 3>> edge_segs_3d;
- std::map<int, RTree<void *, double, 2>> trim_segs;
std::map<int, std::set<cdt_mesh::bedge_seg_t *>> e2polysegs;
std::map<ON_3dPoint *, double> v_min_seg_len;
std::map<int, double> l_median_len;
@@ -214,6 +212,10 @@
/* Face specific data */
std::map<int, struct ON_Brep_CDT_Face_State *> *faces;
+ std::map<int, RTree<void *, double, 3>> edge_segs_3d;
+ std::map<int, RTree<void *, double, 2>> trim_segs;
+ std::map<int, std::map<int,ON_3dPoint *>> strim_pnts;
+ std::map<int, std::map<int,ON_3dPoint *>> strim_norms;
std::map<int, cdt_mesh::cdt_mesh_t> fmeshes;
@@ -265,7 +267,10 @@
void
getSurfacePoints(struct ON_Brep_CDT_Face_State *f);
+void
+GetInteriorPoints(struct ON_Brep_CDT_State *s_cdt, int face_index);
+
struct ON_Brep_CDT_Face_State *
ON_Brep_CDT_Face_Create(struct ON_Brep_CDT_State *s_cdt, int ind);
void
Modified: brlcad/trunk/src/libbrep/cdt2.cpp
===================================================================
--- brlcad/trunk/src/libbrep/cdt2.cpp 2019-08-31 16:05:03 UTC (rev 73806)
+++ brlcad/trunk/src/libbrep/cdt2.cpp 2019-08-31 18:25:13 UTC (rev 73807)
@@ -880,6 +880,7 @@
fv = pv;
// Let cdt_mesh know about new 3D information
+ ON_3dPoint *op3d =
(*s_cdt->vert_pnts)[trim->Vertex(0)->m_vertex_index];
ON_3dVector norm = ON_3dVector::UnsetVector;
if (trim->m_type != ON_BrepTrim::singular) {
// 3D points are globally unique, but normals are not -
the same edge point may
@@ -887,8 +888,14 @@
// face normal for this point on this surface.
ON_3dPoint tmp1;
surface_EvNormal(trim->SurfaceOf(), cp.x, cp.y, tmp1,
norm);
+ } else {
+ // Surface sampling will need some information about
singularities
+ s_cdt->strim_pnts[face_index][trim->m_trim_index] =
op3d;
+ ON_3dPoint *sn3d =
(*s_cdt->vert_avg_norms)[trim->Vertex(0)->m_vertex_index];
+ if (sn3d) {
+ s_cdt->strim_norms[face_index][trim->m_trim_index]
= sn3d;
+ }
}
- ON_3dPoint *op3d =
(*s_cdt->vert_pnts)[trim->Vertex(0)->m_vertex_index];
long f3ind = fmesh->add_point(op3d);
long fnind = fmesh->add_normal(new ON_3dPoint(norm));
fmesh->p2d3d[find] = f3ind;
@@ -908,6 +915,7 @@
cv = cpoly->add_point(cp, find);
// Let cdt_mesh know about the 3D information
+ ON_3dPoint *cp3d =
(*s_cdt->vert_pnts)[trim->Vertex(1)->m_vertex_index];
ON_3dVector norm = ON_3dVector::UnsetVector;
if (trim->m_type != ON_BrepTrim::singular) {
// 3D points are globally unique, but normals are not -
the same edge point may
@@ -915,9 +923,15 @@
// face normal for this point on this surface.
ON_3dPoint tmp1;
surface_EvNormal(trim->SurfaceOf(), cp.x, cp.y, tmp1,
norm);
+ } else {
+ // Surface sampling will need some information about
singularities
+ s_cdt->strim_pnts[face_index][trim->m_trim_index] =
cp3d;
+ ON_3dPoint *sn3d =
(*s_cdt->vert_avg_norms)[trim->Vertex(1)->m_vertex_index];
+ if (sn3d) {
+ s_cdt->strim_norms[face_index][trim->m_trim_index]
= sn3d;
+ }
}
- ON_3dPoint *cp3d =
(*s_cdt->vert_pnts)[trim->Vertex(1)->m_vertex_index];
long f3ind = fmesh->add_point(cp3d);
long fnind = fmesh->add_normal(new ON_3dPoint(norm));
fmesh->p2d3d[find] = f3ind;
@@ -1144,6 +1158,8 @@
}
// TODO - adapt surface point sampling to new setup
+ for (int index = 0; index < brep->m_F.Count(); index++) {
+ }
for (int face_index = 0; face_index < brep->m_F.Count(); face_index++) {
cdt_mesh::cdt_mesh_t *fmesh = &s_cdt->fmeshes[face_index];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits