start )             );         )) )) );         XYZ xyz12 = lCurve1.Curve.get_EndPoint();         XYZ xyz21 = lCurve2.Curve.get_EndPoint();         XYZ xyz22 = lCurve2.Curve.get_EndPoint();         );         XYZ xyz2 = );         XYZ xyz3 = );      …
题目链接:POJ 1269 Problem Description We all know that a pair of distinct points on a plane defines a line and that a pair of lines on a plane will intersect in one of three ways: 1) no intersection because they are parallel, 2) intersect in a line becau…
原题 在金字塔内有一个宝藏p(x,y),现在要取出这个宝藏. 在金字塔内有许多墙,为了进入宝藏所在的房间必须把墙炸开,但是炸墙只能炸每个房间墙的中点. 求将宝藏运出城堡所需要的最小炸墙数. 判断点和直线相交. 枚举每道墙的两个端点和p的连线这条线段和墙的交点的次数最小值即为需要炸墙的最小次数. [注意当墙数为零时输出1:] #include<cstdio> #include<algorithm> #define N 33 using namespace std; int ans=0…
查看 Revit API.发现有Element::IsHidden这个方法.通过UI创建一个element,注意要使得这个element在某些视图可见,但是在另一些视图不可见.运行下面的方法,你会发现几乎所有的视图都会返回true,这个结果并不是我们想要的. public void ishide() { Element elem = Document.GetElement()); FilteredElementCollector fec = new FilteredElementCollecto…
题目链接:https://vjudge.net/problem/POJ-3449 题意:给出若干几何体,判断每个几何体与其它几何体的相交情况,并依次输出. 思路: 首先要知道的是根据正方形对角线的两个点怎么求其它两个点,比如已知(x0,y0),(x2,y2),那么: x1+x3=x0+x2, x1-x3=y2-y0, y1+y3=y0+y2, y1-y3=x0-x2 之后就暴力枚举了,枚举所有几何体的所有边,用线段相交判断几何体相交.这题的输入输出很恶心. AC代码: #include<cstd…
题意:给两条直线,判断相交,重合或者平行 思路:判断重合可以用叉积,平行用斜率,其他情况即为相交. 求交点: 这里也用到叉积的原理.假设交点为p0(x0,y0).则有: (p1-p0)X(p2-p0)=0 (p3-p0)X(p2-p0)=0 展开后即是 (y1-y2)x0+(x2-x1)y0+x1y2-x2y1=0 (y3-y4)x0+(x4-x3)y0+x3y4-x4y3=0 将x0,y0作为变量求解二元一次方程组. 假设有二元一次方程组 a1x+b1y+c1=0; a2x+b2y+c2=0…
OwnerFamily即族模板.获取类别的方法:Document.Settings.Categories.get_Item(BuiltInCategory.OST_Columns); //判断是不是柱族模板 [TransactionAttribute(Autodesk.Revit.Attributes.TransactionMode.Manual)] public class cmdCheckFamily : IExternalCommand {     bool ValidateDocumen…
题目 解法 水题,判断斜率.判断截距,ok..... class CrossLine { public: bool checkCrossLine(double s1, double s2, double y1, double y2) { // write code here if(s1==s2) { if(y1==y2) return true; else return false; } return true; } };…
Jack Straws Description In the game of Jack Straws, a number of plastic or wooden "straws" are dumped on the table and players try to remove them one-by-one without disturbing the other straws. Here, we are only concerned with if various pairs o…
Intersecting Lines Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 8637   Accepted: 3915 Description We all know that a pair of distinct points on a plane defines a line and that a pair of lines on a plane will intersect in one of three…