我想绘制选定实体的边界框。我可以通过逐行绘制来完成它,但是,我看到它提供了 BoundingBox 但我无法让它工作。我不确定它如何添加box
到theModel
以便可以绘制。
theModel.SelectionChanged += (s, e) =>
{
foreach(var selecteditem in e.AddedItems)
if(selecteditem.Item is Entity entity)
selectedEntities.Add(entity);
foreach (var selecteditem in e.RemovedItems)
if (selecteditem.Item is Entity entity)
selectedEntities.Remove(entity);
foreach(var ent in selectedEntities)
{
if(ent is Brep brep)
{
brep = (Brep)ent;
var box = new BoundingBox(font, 6666, true, false, brep.BoxMin, brep.BoxMax);
}
}
theModel.Invalidate();
};