FreeCAD Logo FreeCAD 1.0
  • 영어 아프리칸스어 아랍어 벨라루스어 카탈로니아어 체코어 독일어 그리스어 스페인어 스페인어 바스크어 핀란드어 필리핀어 프랑스어 갈리시아어 크로아티아어 헝가리어 인도네시아어 이탈리아어 일본어 커바일어 한국어 리투아니아어 네덜란드어 노르웨이어(보크말) 폴란드어 포르투갈어 포르투갈어 루마니아어 러시아어 슬로바키아어 슬로베니아어 세르비아어 스웨덴어 터키어 우크라이나어 발센시아어 베트남어 중국어 중국어
  • 특징
  • 다운로드
  • 블로그
  • 문서
    도큐먼트 인덱스 시작하기 사용자 문서 FreeCAD 매뉴얼 워크 벤치 문서 파이썬(Python) 코딩 도큐먼트 C++ coding documentation 자습서 자주 묻는 질문 Privacy policy About FreeCAD
  • 기여
    어떻게 도와 드릴까요 Sponsor 버그 제보 풀 생성 요청 Jobs and funding Contribution guidelines Developers handbook Translations
  • 커뮤니티
    Code of conduct Forum The FPA GitHub GitLab Codeberg Mastodon Matrix IRC IRC via Webchat Gitter Discord Reddit Twitter Facebook LinkedIn Calendar
  • ♥ Donate

Donate

$
SEPA 정보
SEPA 은행을 은행 에이전시로 이체하도록:
Beneficiary: The FreeCAD project association
IBAN: BE04 0019 2896 4531
BIC/SWIFT: GEBABEBBXXX
설정해 주십시오.: BNP Paribas Fortis
주소: Rue de la Station 64, 1360 Perwez, Belgium

While Stripe doesn't support monthly donations, you can still become a sponsor! Simply make a one-time donation equivalent to 12 months of support, and you'll gain access to the corresponding sponsoring tier. It's an easy and flexible way to contribute.

If you are not sure or not able to commit to a regular donation, but still want to help the project, you can do a one-time donation, of any amount.

Choose freely the amount you wish to donate one time only.

You can support FreeCAD by sponsoring it as an individual or organization through various platforms. Sponsorship provides a steady income for developers, allowing the FPA to plan ahead and enabling greater investment in FreeCAD. To encourage sponsorship, we offer different tiers, and unless you choose to remain anonymous, your name or company logo will be featured on our website accordingly.

from 1 USD / 1 EUR per month. You will not have your name displayed here, but you will have helped the project a lot anyway. Together, normal sponsors maintain the project on its feet as much as the bigger sponsors.

from 25 USD / 25 EUR per month. Your name or company name is displayed on this page.

from 100 USD / 100 EUR per month. Your name or company name is displayed on this page, with a link to your website, and a one-line description text.

from 200 USD / 200 EUR per month. Your name or company name and logo displayed on this page, with a link to your website and a custom description text. Companies that have helped FreeCAD early on also appear under Gold sponsors.

Instead of donating each month, you might find it more comfortable to make a one-time donation that, when divided by twelve, would give you right to enter a sponsoring tier. Don't hesitate to do so!

Choose freely the amount you wish to donate each month.

Please inform your forum name or twitter handle as a notein your transfer, or reach to us, so we can give you proper credits!

Apothem Based Prism

Description
This macro will present the user with a dialog to provide the distance between centers, the number of sides, and height and will create a prism based on the apothem, or inradius of a polygon. This can be extremely handy when one only knows the distance between flats. An example of this would be hexagonal stock of plastics or metal provided by vendors. Most vendors define such stock by the distance between flats. If one is using such stock in their projects, this Macro can be a real time saver.

Macro version: 1.0
Last modified: 2014-12-31
FreeCAD version: All
Download: ToolBar Icon
Author: Quick61
Author
Quick61
Download
ToolBar Icon
Links
Macros recipes
How to install macros
How to customize toolbars
Macro Version
1.0
Date last modified
2014-12-31
FreeCAD Version(s)
All
Default shortcut
None
See also
None

설명

이 매크로는 사용자에게 다각형의 한 변과 중심 간 거리, 변의 수, 높이를 입력하는 대화상자를 표시하고 다각형의 변심거리 또는 반지름을 기반으로 각기둥(prism)을 만듭니다. 이 기능은 각기둥의 평면 사이의 거리만 알고 있을 때 매우 유용할 수 있습니다. 이에 대한 예로는 공급업체가 제공하는 육각형 모양의 플라스틱이나 금속 재고를 들 수 있습니다.대부분의 공급업체는 이러한 재고를 평면 간 거리로 정의합니다. 누군가 자신의 프로젝트에 이런 재고를 사용한다면, 이 매크로는 엄청난 시간을 절약해줄 수 있습니다.

사용 방법

Copy the Macro into your FreeCAD Macro directory. Then either run the macro from the Execute Macro dialog or create a shortcut to use from your custom toolbar.

When run, the Macro wil present the user with a dialog like seen below. First enter the desired distance between flats. This can be any number and can include a decimal value, it will not take fractional input. Next enter the number of sides. This number is a whole number and should be an even number as well for proper results. Lastly enter the height you wish the prism to be. Again, this can be any number and can include a decimal value. Click OK and the prism will be created in your document.

The Macro

ToolBar Icon

Macro_Apothem_Based_Prism_GUI.FCMacro

# # # # # # # # # # #
#
# Apothem Based Prism
#
# This script will take the input of the distance between flats, (apothem, aka inradius), 
# and the number of sidesfor a regular polygon along with a height and produce a 
# correctly sized prism derived from the circumradius.
#
# # # # # # # # # # #
 
import FreeCAD, FreeCADGui, Part, PartGui, math
from FreeCAD import Base
from PySide import QtGui, QtCore
from math import cos, radians
App = FreeCAD
Gui = FreeCADGui
 
class p():
 
 
    def priSm(self):
 
        try:
            dbf = float(self.d1.text())
            nos = int(self.d2.text())
            hth = float(self.d3.text())
            aR = dbf / 2
            op1 = 180/float(nos)
            coS = cos(math.radians(op1))
            cR = aR / coS
            prism=App.ActiveDocument.addObject("Part::Prism","Prism")
            prism.Polygon=nos
            prism.Circumradius=cR
            prism.Height=hth
            prism.Placement=Base.Placement(Base.Vector(0.00,0.00,0.00),Base.Rotation(0.00,0.00,0.00,1.00))
            prism.Label='Prism'
            App.ActiveDocument.recompute()
            Gui.SendMsgToActiveView("ViewFit")
        except:
            FreeCAD.Console.PrintError("Unable to complete task")
 
            self.close()
 
    def close(self):
        self.dialog.hide()
 
 
#
# Make dialog box and get input for distance between flats, number of sides, and height
#
 
    def __init__(self):
        self.dialog = None
 
        self.dialog = QtGui.QDialog()
        self.dialog.resize(280,110)
 
        self.dialog.setWindowTitle("Apothem Based Prism")
        la = QtGui.QVBoxLayout(self.dialog)
 
        iN1 = QtGui.QLabel("Distance Between Flats")
        la.addWidget(iN1)
        self.d1 = QtGui.QLineEdit()
        la.addWidget(self.d1)
 
        iN2 = QtGui.QLabel("Number Of Sides (Best results - use even numbers)")
        la.addWidget(iN2)
        self.d2 = QtGui.QLineEdit()
        la.addWidget(self.d2)
 
        iN3 = QtGui.QLabel("Prism Height")
        la.addWidget(iN3)
        self.d3 = QtGui.QLineEdit()
        la.addWidget(self.d3)
 
        okbox = QtGui.QDialogButtonBox(self.dialog)
        okbox.setOrientation(QtCore.Qt.Horizontal)
        okbox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        la.addWidget(okbox)
        QtCore.QObject.connect(okbox, QtCore.SIGNAL("accepted()"), self.priSm)
        QtCore.QObject.connect(okbox, QtCore.SIGNAL("rejected()"), self.close)
        QtCore.QMetaObject.connectSlotsByName(self.dialog)
        self.dialog.show()
        self.dialog.exec_()
 
p()

Additions

SVG icon for use in custom toolbar shortcut.

Acknowledgements

A thanks to FreeCAD main developer shoogen and FreeCAD programmer wandererfan for their invaluable help and advice in constructing this Macro.

이 페이지에서 인용한 것은 https://wiki.freecad.org/Macro_Apothem_Based_Prism_GUI

연락하기!
Forum GitHub Mastodon Matrix IRC Gitter.im Discord Reddit Twitter Facebook LinkedIn

© The FreeCAD Team. Homepage image credits (top to bottom): ppemawm, r-frank, epileftric, regis, rider_mortagnais, bejant.

이 프로젝트는 이들에 의해 지원되었습니다: , KiCad Services Corp. and other sponsors

GitHubImprove this page on GitHub