Comments (4)
There is no function in lc::geo::Vector
, you have to create a lc::entity:Line
and use the rotate function (with an angle of M_PI / 2
or -M_PI / 2
).
To get the intersection of two vectors, look at lc::maths::Intersect
https://github.com/LibreCAD/LibreCAD_3/blob/master/lckernel/cad/math/intersect.h
The code will look like this :
lc::maths::Intersect intersect(lc::maths::Intersect::OnEntity, LCTOLERANCE);
intersect(v1, v2);
intersect.result(); //Contains the intersection point if it exists
from librecad_3.
I am trying to create circle using 3points in circleoperations.lua
I need to find the circumcenter of the triangle from 3 points
function CircleOperations:Circumcenter(Point1,Point2,Point3)
MidPoint1=Point1:mid(Point2)
MidPoint2=Point2:mid(Point3)
Line1=lc.entity.Line(Point1,Point2)
Line2=lc.entity.Line(Point2,Point3)
Line1=Line1:rotate(MidPoint1,M_PI / 2)
Line2=Line2:rotate(MidPoint2,M_PI / 2)
end
I don't know how to correctly code rotate function and then get intersection of both lines in LUA
from librecad_3.
You have to replace M_PI
with math.pi
and it should work
from librecad_3.
Anyways I found a direct formula for Circumcenter which is better than finding intersection of perpendicular. New code is in #206
from librecad_3.
Related Issues (20)
- Dark theme icons support HOT 5
- [openSUSE] How to compile LibreCAD3 with system installed tinyspline? HOT 3
- Dependency rapidjson should be added to build instructions HOT 9
- Is posible compile Librecad_3 using Mingw in Windows 10? HOT 4
- make -j 4 make: *** No targets specified and no makefile found. Stop. HOT 3
- Failed to build: error: no return statement in function returning non-void HOT 2
- Failed to build CMakeFiles/luacmdinterface.dir/main.cpp.o: in function CairoStore::image_create HOT 1
- Visual Programming for interconnect to others programs.
- DGN v7 file support HOT 1
- DimensionLinear Alignment
- LibreCAD3 works but it display some issues in terminal HOT 1
- ‘class tinyspline::BSpline’ has no member named ‘data’ HOT 2
- Segmentation fault in GL_Font::readyFont HOT 1
- why not libdxfrw as a git submodule? HOT 1
- Segmentation fault in lcunittest
- Can't open newly created 2D .dxf file HOT 1
- cmake is detecting lua 5.4 instead of 5.3 HOT 2
- LibreCAD_3 Whether you plan to support 3D? HOT 4
- Lua 5.3.6
- Define `main` branch as default instead of `master` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from librecad_3.