Open CASCADE学习|按圆离散旋转体
旋转体是一个非常重要的概念,它涉及到三维空间中由二维曲线绕某一轴线旋转形成的立体形状。这种旋转体的形成过程,实际上是一个连续变化的动态过程,但在数学和几何学中,我们往往通过静态的方式来描述和研究它。
旋转体的基本特性包括其形状、大小、表面积和体积等。这些特性不仅取决于原始二维曲线的形状和大小,还受到旋转轴线位置和方向的影响。例如,一个圆绕其直径旋转会形成球体,而绕其切线旋转则会形成圆柱体。
将旋转体离散为一系列的圆(通常称为“截圆”或“横截面”)是一种常用的近似方法,用于在数值计算、计算机图形学以及物理模拟中描述和分析旋转体的性质。这种方法的基本思想是将连续的旋转体划分为一系列离散的、平行的截面,每个截面都是一个圆。
需要注意的是,离散化的精度取决于截面间距的选择。较小的间距可以提高精度,但也会增加计算复杂性和存储需求。因此,在实际应用中,需要根据具体需求和资源限制来选择合适的离散化方案。
#include <Geom_CylindricalSurface.hxx>
#include <gp_Ax3.hxx>
#include <GeomAPI_Interpolate.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <GCE2d_MakeSegment.hxx>#include <GeomAPI_PointsToBSpline.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <GC_MakeCircle.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepOffsetAPI_MakePipe.hxx>
#include <GC_MakeArcOfCircle.hxx>
#include <BRepAlgoAPI_Fuse.hxx>#include <gp_GTrsf.hxx>
#include <BRepBuilderAPI_Transform.hxx>#include"Viewer.h"#include <BRepPrimAPI_MakeCylinder.hxx>
#include <BRepBuilderAPI_MakePolygon.hxx>
#include <BRep_Tool.hxx>
#include <TopoDS.hxx>
#include <BRepAlgoAPI_Cut.hxx>
#include <BRepAlgoAPI_Common.hxx>
#include <BRepAlgoAPI_Section.hxx>
#include <BRepPrimAPI_MakePrism.hxx>
#include <GC_MakeSegment.hxx>
#include <IntAna2d_AnaIntersection.hxx>
#include <ShapeUpgrade_UnifySameDomain.hxx>
#include <BRepTools_WireExplorer.hxx>
#include <GeomFill_TrihedronLaw.hxx>
#include <GeomFill_Frenet.hxx>
#include <GeomFill_CurveAndTrihedron.hxx>
#include <BRepFill_Edge3DLaw.hxx>
#include <BRepFill_SectionPlacement.hxx>
#include <ShapeUpgrade_RemoveLocations.hxx>
#include <BRepPrimAPI_MakeSphere.hxx>
#include <BRepPrimAPI_MakeRevol.hxx>
#include <BRepAdaptor_CompCurve.hxx>
#include <TopExp_Explorer.hxx>
#include <NCollection_Sequence.hxx>
TopoDS_Edge axis;
NCollection_Sequence<TopoDS_Edge> SplitShapebyaxis(TopoDS_Shape input, TopoDS_Edge cutaxis)
{Standard_Real startParam(0.), endParam(0.);Handle(Geom_Curve) c = BRep_Tool::Curve(cutaxis, startParam, endParam);//得到底层曲线Standard_Real step = (endParam - startParam) / 100;TColgp_HArray1OfPnt Points(1, 101);for (int i = 0; i < 101; i++) {Points[i + 1] = c->Value(startParam + i * step);}gp_Vec dir(Points[1], Points[101]);NCollection_Sequence<TopoDS_Edge> edgeall;for (int i = 2; i < 100; i++){gp_Pln cutplane(Points[i], dir);TopoDS_Face cf = BRepBuilderAPI_MakeFace(cutplane);// 进行布尔运算BRepAlgoAPI_Section section(input, cf, Standard_False);section.ComputePCurveOn1(Standard_True);section.Approximation(Standard_False);section.Build();TopExp_Explorer anExp(section.Shape(), TopAbs_EDGE);int j = 0;for (; anExp.More(); anExp.Next()){TopoDS_Edge anEdge = TopoDS::Edge(anExp.Current());edgeall.Append(anEdge);j++;}//std::cout << "j=" << j << std::endl;}return edgeall;
}
TopoDS_Edge createHelix(const Standard_Real HelixRadius, const Standard_Real HelixAngle, const Standard_Real HelixLength)
{Standard_Real u0 = 0.0;Standard_Real u1 = 2 * M_PI;Standard_Real v0 = 0.0;Standard_Real v1 = HelixLength;double uInter = (u1 - u0) / 1000;double vInter = (v1 - v0) / 1000;TColgp_HArray1OfPnt Points(1, 1001);Handle(Geom_CylindricalSurface) aCylinder = new Geom_CylindricalSurface(gp::XOY(), HelixRadius);double u;double v;//生成点for (int i = 0; i < 1001; i++) {u = i * vInter * tan(HelixAngle) / HelixRadius;v = i * vInter;Points[i + 1] = aCylinder->Value(u, v);}GeomAPI_PointsToBSpline Approx(Points);Handle_Geom_BSplineCurve K = Approx.Curve();TopoDS_Edge aHelixEdge = BRepBuilderAPI_MakeEdge(K);return aHelixEdge;
}TopoDS_Shape createGrindingwheel2()
{Standard_Real Line1_angle = 280 * M_PI / 180;Standard_Real Line1_length = 0.5031;Standard_Real Line2_angle = 236 * M_PI / 180;Standard_Real Line2_length = 0.5925;Standard_Real Arc1_r = 0.112;Standard_Real Arc1_angle = (180 + 10 + 50) * M_PI / 180;gp_Pnt Line1_p1(-0.6822 / 2, 0, 0);gp_Pnt Line2_p1(0.6822 / 2, 0, 0);gp_Lin Line1(Line1_p1, gp_Dir(cos(Line1_angle), sin(Line1_angle), 0.));gp_Lin Line2(Line2_p1, gp_Dir(cos(Line2_angle), sin(Line2_angle), 0.));Handle(Geom_TrimmedCurve) L1 = GC_MakeSegment(Line1, 0., Line1_length);TopoDS_Edge L1e = BRepBuilderAPI_MakeEdge(L1);Handle(Geom_TrimmedCurve) L2 = GC_MakeSegment(Line2, 0., Line2_length);TopoDS_Edge L2e = BRepBuilderAPI_MakeEdge(L2);gp_Pnt l1end = L1->EndPoint();gp_Pnt l2end = L2->EndPoint();gp_Lin Line1v(l1end, gp_Dir(cos(Line1_angle + M_PI_2), sin(Line1_angle + M_PI_2), 0.));gp_Lin2d Line2v(gp_Pnt2d(l2end.X(), l2end.Y()), gp_Dir2d(cos(Line2_angle - M_PI_2), sin(Line2_angle - M_PI_2)));gp_Lin Line2v3d(l2end, gp_Dir(cos(Line2_angle - M_PI_2), sin(Line2_angle - M_PI_2), 0.));Handle(Geom_TrimmedCurve) L1v = GC_MakeSegment(Line1v, 0., Arc1_r);gp_Pnt l1vend = L1v->EndPoint();gp_Circ c1(gp_Ax2(l1vend, gp_Dir(0, 0, 1)), Arc1_r);Handle(Geom_TrimmedCurve) c1c = GC_MakeArcOfCircle(c1, l1end, Arc1_angle, 1);gp_Pnt c1end = c1c->EndPoint();gp_Lin2d Line3(gp_Pnt2d(c1end.X(), c1end.Y()), gp_Dir2d(l2end.X() - c1end.X(), l2end.Y() - c1end.Y()));gp_Lin2d Line3v = Line3.Normal(gp_Pnt2d((l2end.X() + c1end.X()) / 2, (l2end.Y() + c1end.Y()) / 2));IntAna2d_AnaIntersection aIntAna;aIntAna.Perform(Line2v, Line3v);IntAna2d_IntPoint aIntPoint = aIntAna.Point(1);gp_Pnt o2(aIntPoint.Value().X(), aIntPoint.Value().Y(), 0.);Handle(Geom_TrimmedCurve) L2v = GC_MakeSegment(Line2v3d, l2end, o2);Standard_Real r2 = L2v->LastParameter();gp_Circ c2(gp_Ax2(o2, gp_Dir(0, 0, 1)), r2);Handle(Geom_TrimmedCurve) c2c = GC_MakeArcOfCircle(c2, c1end, l2end, 0);gp_Pnt c2low = c2c->Value(M_PI_2);TopoDS_Edge c1ce = BRepBuilderAPI_MakeEdge(c1c);TopoDS_Edge L1ev = BRepBuilderAPI_MakeEdge(L1v);TopoDS_Edge c2ce = BRepBuilderAPI_MakeEdge(c2c);gp_Pnt Line1_up(-0.9832 / 2, 5, 0);gp_Pnt Line2_up(0.9832 / 2, 5, 0);TopoDS_Edge anEdge1 = BRepBuilderAPI_MakeEdge(Line1_p1, Line1_up);TopoDS_Edge anEdge2 = BRepBuilderAPI_MakeEdge(Line1_up, Line2_up);TopoDS_Edge anEdge3 = BRepBuilderAPI_MakeEdge(Line2_up, Line2_p1);TopTools_ListOfShape listEdge;listEdge.Append(anEdge1);listEdge.Append(anEdge2);listEdge.Append(anEdge3);listEdge.Append(L1e);listEdge.Append(c1ce);listEdge.Append(c2ce);listEdge.Append(L2e);BRepBuilderAPI_MakeWire mw;mw.Add(listEdge);mw.Build();TopoDS_Edge tmpAxis = BRepBuilderAPI_MakeEdge(gp_Pnt(-0.9832 / 2, 5, 0), gp_Pnt(0.9832 / 2, 5, 0));TopoDS_Shape gwheel = BRepPrimAPI_MakeRevol(mw, gp_Ax1(gp_Pnt(0, 5, 0), gp_Dir(1, 0, 0)), 2 * M_PI);//平移到最低点与原点重合gp_Trsf theTransformation1;gp_Vec theVectorOfTranslation1(-c2low.X(), -c2low.Y(), 0.);theTransformation1.SetTranslation(theVectorOfTranslation1);//往上平移芯厚一半的距离gp_Trsf theTransformation2;gp_Vec theVectorOfTranslation2(0., 0.125 / 2, 0.);theTransformation2.SetTranslation(theVectorOfTranslation2);//顺时针旋转90°,绕z轴gp_Trsf theTransformation3;gp_Ax1 axez = gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0., 0., 1.));theTransformation3.SetRotation(axez, -90 * M_PI / 180);//顺时针旋转50°,绕x轴gp_Trsf theTransformation4;gp_Ax1 axex = gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(1., 0., 0.));theTransformation4.SetRotation(axex, -50 * M_PI / 180);//实施以上变换:对旋转体、对轴线BRepBuilderAPI_Transform myBRepTransformation(gwheel, theTransformation4 * theTransformation3 * theTransformation2* theTransformation1);TopoDS_Shape TransformedShape = myBRepTransformation.Shape();BRepBuilderAPI_Transform myBRepTransformation2(tmpAxis, theTransformation4 * theTransformation3 * theTransformation2 * theTransformation1);TopoDS_Shape initAxis = myBRepTransformation2.Shape();axis = TopoDS::Edge(initAxis);return TransformedShape;
}
TopoDS_Shape getShapeOnPosition(TopoDS_Shape myProfile, Handle(BRepFill_LocationLaw) myLoc, Standard_Real pos, Standard_Real a, Standard_Real b, gp_Trsf myTrsf)
{TopoDS_Shape myPos;Handle(GeomFill_LocationLaw) law;gp_Mat M;gp_Vec V;gp_Trsf fila;Standard_Real first, last;myLoc->Law(1)->GetDomain(first, last);Standard_Real px = (pos - a) / (b - a);myLoc->Law(1)->D0(px, M, V);fila.SetValues(M(1, 1), M(1, 2), M(1, 3), V.X(),M(2, 1), M(2, 2), M(2, 3), V.Y(),M(3, 1), M(3, 2), M(3, 3), V.Z());fila.Multiply(myTrsf);myPos = myProfile;TopLoc_Location LocPos(fila);if (!LocPos.IsIdentity()) {myPos = BRepBuilderAPI_Transform(myProfile, fila, Standard_True); //copy}ShapeUpgrade_RemoveLocations RemLoc;RemLoc.SetRemoveLevel(TopAbs_COMPOUND);RemLoc.Remove(myPos);myPos = RemLoc.GetResult();return myPos;
}
int main(int argc, char* argv[])
{gp_Dir Z(0.0, 0.0, 1.0);gp_Pnt center(0, 0, 0.0);gp_Pnt xr(0.5, 0, 0.0);gp_Pnt yr(0.0, 1.0, 0.0);gp_Pnt zr(0.0, 0.0, 7.0);gp_Ax2 wb(center, Z);gp_Circ wbcircle(wb, 0.125 / 2);TopoDS_Edge wbe = BRepBuilderAPI_MakeEdge(wbcircle);TopoDS_Edge xline = BRepBuilderAPI_MakeEdge(center, xr);TopoDS_Edge yline = BRepBuilderAPI_MakeEdge(center, yr);TopoDS_Edge zline = BRepBuilderAPI_MakeEdge(center, zr);//creat a profile of gringing wheelTopoDS_Shape gw = createGrindingwheel2();//creat a cylinder surfaceStandard_Real R = 0.306 / 2;Handle(Geom_CylindricalSurface) aCylinder = new Geom_CylindricalSurface(gp::XOY(), R);TopoDS_Shape cF = BRepBuilderAPI_MakeFace(aCylinder->Cylinder(), 0, 2 * M_PI, 0, 3.);TopoDS_Solid cys = BRepPrimAPI_MakeCylinder(gp::XOY(), R, 7);TopoDS_Edge aE = createHelix(R, M_PI / 4, 6.);TopoDS_Wire spine = BRepBuilderAPI_MakeWire(aE);TopoDS_Wire mySpine;TopoDS_Shape myProfile;TopoDS_Shape myShape;gp_Trsf myTrsf;Handle(BRepFill_LocationLaw) myLoc;Handle(TopTools_HArray2OfShape) mySections;Handle(TopTools_HArray2OfShape) myFaces;Handle(TopTools_HArray2OfShape) myEdges;TopTools_MapOfShape myReversedEdges;BRepFill_DataMapOfShapeHArray2OfShape myTapes;BRepFill_DataMapOfShapeHArray2OfShape myRails;Standard_Integer myCurIndexOfSectionEdge;TopoDS_Shape myFirst;TopoDS_Shape myLast;TopTools_DataMapOfShapeListOfShape myGenMap;Standard_Integer myDegmax;Standard_Integer mySegmax;GeomAbs_Shape myContinuity;GeomFill_Trihedron myMode;Standard_Boolean myForceApproxC1;Standard_Real myErrorOnSurf;mySections.Nullify();myFaces.Nullify();myEdges.Nullify();mySpine = spine;myProfile = gw;//myProfile = BRepPrimAPI_MakeSphere(gp_Pnt(0.306/2, 0., 0.),0.306/2);TopoDS_Shape TheProf;Handle(GeomFill_TrihedronLaw) TLaw;TLaw = new GeomFill_Frenet();Handle(GeomFill_CurveAndTrihedron) Loc = new (GeomFill_CurveAndTrihedron) (TLaw);myLoc = new (BRepFill_Edge3DLaw) (mySpine, Loc);if (myLoc->NbLaw() == 0) {return 0; // Degenerated case}myLoc->TransformInG0Law(); // Set into continuityBRepFill_SectionPlacement Place(myLoc, gw);myTrsf = Place.Transformation();TopLoc_Location Loc2(myTrsf), Loc1;Loc1 = gw.Location();TopoDS_Shape aux;TheProf = myProfile;TheProf.Location(Loc2.Multiplied(Loc1));// Construct First && Last ShapeHandle(GeomFill_LocationLaw) law;gp_Mat M;gp_Vec V;gp_Trsf fila;Standard_Real first, last;myLoc->Law(1)->GetDomain(first, last);myLoc->Law(1)->D0(first, M, V);fila.SetValues(M(1, 1), M(1, 2), M(1, 3), V.X(),M(2, 1), M(2, 2), M(2, 3), V.Y(),M(3, 1), M(3, 2), M(3, 3), V.Z());fila.Multiply(myTrsf);TopLoc_Location LocFirst(fila);myFirst = myProfile;if (!LocFirst.IsIdentity()) {//myFirst.Location( LocFirst.Multiplied(myProfile.Location()) );myFirst = BRepBuilderAPI_Transform(myProfile, fila, Standard_True); //copy}ShapeUpgrade_RemoveLocations RemLoc;RemLoc.SetRemoveLevel(TopAbs_COMPOUND);RemLoc.Remove(myFirst);myFirst = RemLoc.GetResult();myLoc->Law(myLoc->NbLaw())->GetDomain(first, last);myLoc->Law(myLoc->NbLaw())->D0(last, M, V);// try { // Not good, but there are no other means to test SetValuesfila.SetValues(M(1, 1), M(1, 2), M(1, 3), V.X(),M(2, 1), M(2, 2), M(2, 3), V.Y(),M(3, 1), M(3, 2), M(3, 3), V.Z());fila.Multiply(myTrsf);TopLoc_Location LocLast(fila);if (!myLoc->IsClosed() || LocFirst != LocLast) {myLast = myProfile;if (!LocLast.IsIdentity()) {//myLast.Location(LocLast.Multiplied(myProfile.Location()) );myLast = BRepBuilderAPI_Transform(myProfile, fila, Standard_True); //copy}}else {myLast = myFirst;}RemLoc.Remove(myLast);myLast = RemLoc.GetResult();NCollection_Sequence<TopoDS_Edge> es=SplitShapebyaxis(gw, axis);Viewer vout(50, 50, 500, 500);vout << wbe;vout << xline;vout << yline;vout << zline;vout << gw;vout << axis;// 遍历点集合for (int i = 1; i <= es.Length(); ++i) {vout << es.Value(i);}vout.StartMessageLoop();return 0;
}
相关文章:

Open CASCADE学习|按圆离散旋转体
旋转体是一个非常重要的概念,它涉及到三维空间中由二维曲线绕某一轴线旋转形成的立体形状。这种旋转体的形成过程,实际上是一个连续变化的动态过程,但在数学和几何学中,我们往往通过静态的方式来描述和研究它。 旋转体的基本特性…...

无人矿车使用ZMQ消息代理进行跨机互联进行消息收发
目录 背景 前景知识 1.启动一个代理服务器 2.发布者 3.订阅者 实际应用 1.模拟智驾收来自交互箱131的按钮json数据 2.模拟交互箱131收来自智驾137的cjson数据 背景 在调试防爆无轨无人矿车时,出现消息代理不能很好转发,于是在公司通过代理的方式…...

医疗机构关于DIP/DRG信息化建设
推进DIP/DRG支付方式改革是一项系统性工程,牵一发而动全身。作为河北省DIP试点医院,河北医科大学第二医院将信息化与创新性管理理念融合,用好支付工具做好精细化管理,积极应对改革。 ■ 改革背景 国家医疗保障局制定的《DRG/DIP支…...

100个候选人,没一个能讲明白什么是自动化框架?
什么是自动化测试框架 01 什么是框架 框架是整个或部分系统的可重用设计,表现为一组抽象构件及构件实例间交互的方法。它规定了应用的体系结构,阐明了整个设计、协作构件之间的依赖关系、责任分配和控制流程,表现为一组抽象类以及其实例之间…...

数据结构与算法1: 链表
题目名称: 重排链表 链接: . - 力扣(LeetCode) 介绍:本题的目标是将链表进行重新组合,如下图。 如果按照标准的解法,我们需要实现三步 1. 链表中点的获取 2. 链表的反转 3. 链…...

【专题】2024年8月医药行业报告合集汇总PDF分享(附原数据表)
原文链接:https://tecdat.cn/?p37621 在科技飞速发展的当今时代,医药行业作为关乎人类生命健康的重要领域,正处于前所未有的变革浪潮之中。数智医疗服务的崛起,为医疗模式带来了全新的转变,开启了医疗服务的新时代。…...
这10种人不适合干项目经理,你在其中吗?
在一个项目中,项目经理扮演着至关重要的角色,他们需要协调各种资源、管理团队、制定计划以及应对各种挑战。然而,并非每个人都适合担任项目经理的角色。以下他们天生不适合当项目经理,你会在其中找到自己的类型吗? 1、…...
IT每日英语(三)
系列文章目录 IT每日英语(二) 文章目录 系列文章目录前言1.collie2.century3.farewell4.meme5.hall6.needle7.simulate8.emulate9.arbitray10.laboratory11.jest12.suite13.approach14.satellite15.instance16.representation 前言 这里给出的是本人在…...

【保姆级教程】如何创建一个vitepress项目?
文章目录 安装前的准备工作项目安装创建文件初始化文件安装依赖遇到了 missing peer deps 警告?命令行设置向导 完成 安装前的准备工作 Node.js 18 及以上版本。通过命令行界面 (CLI) 访问 VitePress 的终端。支持 Markdown 语法的编辑器。推荐 VSCode 及其官方 Vu…...

智能头盔语音识别声控芯片,AI离线语音识别ic方案,NRK3301
头盔是交通事故中保护电动车车主安全的最后一道屏障。为了增加骑行用户的安全保护,改善骑行用户的出行体验,让用户从被动使用头盔到主动佩戴头盔,头盔厂家与九芯电子合作,推出了语音智能头盔,它具备首家骑行专用的智能…...

【STM32】CAN总线基础入门
CAN总线基础入门 一、CAN简介二、主流通信协议对比三、CAN物理层1、CAN硬件电路2、CAN电平标准3、CAN收发器 – TJA1050(高速CAN)4、CAN物理层特性 四、帧格式1、CAN总线帧格式2、数据帧3、数据帧各部分用途简介4、数据帧的发展历…...

STM32F1+HAL库+FreeTOTS学习10——任务相关API函数使用
STM32F1HAL库FreeTOTS学习10——任务相关API函数使用 任务相关API函数1. uxTaskPriorityGet()2. vTaskPrioritySet()3. uxTaskGetNumberOfTasks()4. uxTaskGetSystemState()5. vTaskGetInfo()6. xTaskGetCurrentHandle()7. xTaskGetHandle()8. xTaskGetIdleTaskHandle()9. uxTa…...

华为 HCIP-Datacom H12-821 题库 (14)
有需要题库的可以加下方Q群 V群进行学习交流 1.以下哪一种工具可用于多种路由协议,并且是由 if-match 和appl y 子句组成的? A、community-filter B、as-path-filter C、route-policy D、ip-prefix 答案:C 解析: 暂无解析…...
java八股!2
IO流 好短 就三个问题(io流,区别,NIO实现) 文章目录 IO流io流基本认识字节流和字符流的区别(中文,底层设备,缓冲区,应用场景)I/O模型(4种(可以看做3种&…...

一分钟了解统一软件开发过程RUP的那点事
曾经几乎一统天下的统一软件开发过程RUP(Rational Unified Process)即使是现在看来,它也是一套非常先进并完整的理论体系加工具集合。虽然目前来看,敏捷开发方法似乎更优秀,但是到今天为止,几乎大部分的政府…...

Goby 漏洞发布|(CVE-2024-45195)Apache OFBiz /viewdatafile 代码执行漏洞【已复现】
漏洞名称:Apache OFBiz /viewdatafile 代码执行漏洞(CVE-2024-45195) English Name:Apache OFBiz /viewdatafile Code Execution Vulnerability(CVE-2024-45195) CVSS core: 8.0 漏洞描述: Apache OFBiz是一个开源…...
js的书写位置和css的书写位置的区别?为什么要这样写?
JavaScript 和 CSS 的书写位置有以下区别: CSS 通常写在 <style> 标签中,或者在外部样式表文件中(<link rel"stylesheet" href"styles.css">)。CSS 主要用于控制页面的视觉样式和布局,…...
Python一些可能用的到的函数系列132 ORM-sqlalchemy连clickhouse
说明 继续ORM的转换 通过ORM,可以: 1 用几乎一样的方式来操作不同的数据库2 可以提供One的处理模式 内容 同步方式 这种方式更简单,适合处理小批量任务。这种操作严格来说,不是严格的One,而是MiniBatch,…...

华为 HCIP-Datacom H12-821 题库 (12)
有需要题库的可以看主页置顶 V群进行学习交流 1.设备使能 BGP 自动聚合功能后,可将 10.1.1.1/24 和 10.2.1.1/24路由聚合成以下哪一项? A、10.2.1.0/24 B、10.0.0.0/14 C、10.0.0.0/8 D、10.1.1.0/24 答案:C 解析: 暂无解析 2.关…...
pointpillar部署-TensorRT实现(三)
模型后处理 __global__ void postprocess_kernal(const float *cls_input,float *box_input,const float *dir_cls_input,float *anchors,float *anchor_bottom_heights,float *bndbox_output,int *object_counter,const float min_x_range,const float max_x_range,const flo…...

深入浅出Asp.Net Core MVC应用开发系列-AspNetCore中的日志记录
ASP.NET Core 是一个跨平台的开源框架,用于在 Windows、macOS 或 Linux 上生成基于云的新式 Web 应用。 ASP.NET Core 中的日志记录 .NET 通过 ILogger API 支持高性能结构化日志记录,以帮助监视应用程序行为和诊断问题。 可以通过配置不同的记录提供程…...

前端导出带有合并单元格的列表
// 导出async function exportExcel(fileName "共识调整.xlsx") {// 所有数据const exportData await getAllMainData();// 表头内容let fitstTitleList [];const secondTitleList [];allColumns.value.forEach(column > {if (!column.children) {fitstTitleL…...

转转集团旗下首家二手多品类循环仓店“超级转转”开业
6月9日,国内领先的循环经济企业转转集团旗下首家二手多品类循环仓店“超级转转”正式开业。 转转集团创始人兼CEO黄炜、转转循环时尚发起人朱珠、转转集团COO兼红布林CEO胡伟琨、王府井集团副总裁祝捷等出席了开业剪彩仪式。 据「TMT星球」了解,“超级…...

微信小程序云开发平台MySQL的连接方式
注:微信小程序云开发平台指的是腾讯云开发 先给结论:微信小程序云开发平台的MySQL,无法通过获取数据库连接信息的方式进行连接,连接只能通过云开发的SDK连接,具体要参考官方文档: 为什么? 因为…...

select、poll、epoll 与 Reactor 模式
在高并发网络编程领域,高效处理大量连接和 I/O 事件是系统性能的关键。select、poll、epoll 作为 I/O 多路复用技术的代表,以及基于它们实现的 Reactor 模式,为开发者提供了强大的工具。本文将深入探讨这些技术的底层原理、优缺点。 一、I…...

【分享】推荐一些办公小工具
1、PDF 在线转换 https://smallpdf.com/cn/pdf-tools 推荐理由:大部分的转换软件需要收费,要么功能不齐全,而开会员又用不了几次浪费钱,借用别人的又不安全。 这个网站它不需要登录或下载安装。而且提供的免费功能就能满足日常…...

三分算法与DeepSeek辅助证明是单峰函数
前置 单峰函数有唯一的最大值,最大值左侧的数值严格单调递增,最大值右侧的数值严格单调递减。 单谷函数有唯一的最小值,最小值左侧的数值严格单调递减,最小值右侧的数值严格单调递增。 三分的本质 三分和二分一样都是通过不断缩…...

C# 表达式和运算符(求值顺序)
求值顺序 表达式可以由许多嵌套的子表达式构成。子表达式的求值顺序可以使表达式的最终值发生 变化。 例如,已知表达式3*52,依照子表达式的求值顺序,有两种可能的结果,如图9-3所示。 如果乘法先执行,结果是17。如果5…...
嵌入式常见 CPU 架构
架构类型架构厂商芯片厂商典型芯片特点与应用场景PICRISC (8/16 位)MicrochipMicrochipPIC16F877A、PIC18F4550简化指令集,单周期执行;低功耗、CIP 独立外设;用于家电、小电机控制、安防面板等嵌入式场景8051CISC (8 位)Intel(原始…...

AI语音助手的Python实现
引言 语音助手(如小爱同学、Siri)通过语音识别、自然语言处理(NLP)和语音合成技术,为用户提供直观、高效的交互体验。随着人工智能的普及,Python开发者可以利用开源库和AI模型,快速构建自定义语音助手。本文由浅入深,详细介绍如何使用Python开发AI语音助手,涵盖基础功…...